CodeGym /కోర్సులు /జావా సింటాక్స్ /ప్రింట్ () మరియు println ();

ప్రింట్ () మరియు println ();

జావా సింటాక్స్
స్థాయి, పాఠం
అందుబాటులో ఉంది

"హాయ్, ఇది మళ్లీ నేనే. ఈ రోజు నేను మీకు మూడు పాఠాలు ఇస్తాను. మరియు ఇది రెండవది! మిమ్మల్ని మీరు హాయిగా చేసుకోండి మరియు వినండి. స్క్రీన్‌పై వచనాన్ని ప్రదర్శించడం గురించి నేను మీకు చెప్పబోతున్నాను. నిజానికి ఇది చాలా సులభం:"

జావా కోడ్ స్క్రీన్‌పై ఏమి ప్రదర్శించబడుతుంది
System.out.println("Diego");
System.out.println(3);
System.out.println("Rain" + "In" + "Spain");
Diego
3
RainInSpain
System.out.println(1 + 3);
System.out.println("1" + "3");
System.out.println(1 + "3");
System.out.println("1" + 3);
System.out.println("1" + (1 + 3));
4
13
13
13
14
System.out.println("Amigo is the best!");
System.out.println("Amigo" + "is the best!");
System.out.println("Amigo" + " " + "is the best!");
Amigo is the best!
Amigois the best!
Amigo is the best!
System.out.println(3 * 3 + 4 * 4);
System.out.println(1 * 2 + 3 * 4);
25
14
System.out.print("Diego");
System.out.print("Diego");
System.out.print("Diego");
DiegoDiegoDiego
System.out.print("Diego ");
System.out.println("is the best!");
System.out.print("Amigo ");
System.out.println("is the best!");
Diego is the best!
Amigo is the best!

" ప్రింట్() మరియు println() గురించి మరొకసారి చెప్పగలరా ?"

" ప్రింట్() , ఫంక్షన్ స్క్రీన్‌పై టెక్స్ట్‌ని, క్యారెక్టర్ ద్వారా క్యారెక్టర్‌ని ప్రదర్శించడానికి ఉపయోగించబడుతుంది. స్క్రీన్‌కి ఇకపై లైన్‌లో స్థలం లేనప్పుడు, టెక్స్ట్ తదుపరి లైన్‌లో ప్రదర్శించబడటం ప్రారంభమవుతుంది. మీరు println() ఫంక్షన్‌ని ఉపయోగించవచ్చు. ప్రస్తుత పంక్తిలో వచనం నిండకముందే ప్రదర్శించడాన్ని ఆపివేయడానికి. తదుపరి టెక్స్ట్ తదుపరి లైన్‌లో కనిపిస్తుంది."

"సరే. మరియు సంఖ్యలు మరియు స్ట్రింగ్‌లను జోడించడంలో ఆ ట్రిక్ ఏమిటి?"

"మీరు రెండు సంఖ్యలను జోడిస్తే, ఫలితం కూడా ఒక సంఖ్య: 2+2 4కి సమానం. మీరు ఒక సంఖ్య మరియు స్ట్రింగ్‌ని జోడిస్తే, ఆ సంఖ్య స్ట్రింగ్‌గా మార్చబడుతుంది. ఆ తర్వాత రెండు స్ట్రింగ్‌లు కేవలం ఒకదానితో ఒకటి కలిసిపోతాయి."

"ఓహ్! ఉదాహరణలను చూడటం నుండి నేను అదే అనుకున్నాను, కానీ ఎవరికి తెలుసు. ఈ ఆసక్తికరమైన పాఠానికి ధన్యవాదాలు, ఎల్లీ."

"మీకు స్వాగతం. చివరగా, డియెగో నుండి కొన్ని పనులు ఇక్కడ ఉన్నాయి. నేను మీ పురోగతిని తనిఖీ చేయాలని అతను కోరుకున్నాడు."

1
టాస్క్
జావా సింటాక్స్, స్థాయి, పాఠం
లాక్ చేయబడింది
Finding bugs
Finding bugs
1
టాస్క్
జావా సింటాక్స్, స్థాయి, పాఠం
లాక్ చేయబడింది
We don't need any extra lines
We don't need any extra lines
1
టాస్క్
జావా సింటాక్స్, స్థాయి, పాఠం
లాక్ చేయబడింది
Code entry
Sometimes you don't need to think, you just need to hammer it out! As paradoxical as it may seem, sometimes your fingers will "remember" better than your conscious mind. That's why while training at the secret CodeGym center you will sometimes encounter tasks that require you to enter code. By entering code, you get used to the syntax and earn a little dark matter. What's more, you combat laziness!
వ్యాఖ్యలు
TO VIEW ALL COMMENTS OR TO MAKE A COMMENT,
GO TO FULL VERSION