కోడ్‌జిమ్ విశ్వవిద్యాలయం కోర్సులో భాగంగా మెంటర్‌తో ఉపన్యాస స్నిప్పెట్. పూర్తి కోర్సు కోసం సైన్ అప్ చేయండి.


"హాయ్, అమిగో."

"హలో, ఎలియనోర్ క్యారీ."

"నన్ను ఎల్లీ అని పిలవండి. అంత లాంఛనంగా ఉండవలసిన అవసరం లేదు."

"సరే, ఎల్లీ."

"నా సహాయంతో మీరు త్వరలో అత్యుత్తమ వ్యక్తులలో ఒకరిగా అవుతారని నేను నమ్ముతున్నాను. నాకు చాలా అనుభవం ఉన్న శిక్షణా రూకీలు ఉన్నాయి. నాతో ఉండండి మరియు అంతా బాగానే ఉంటుంది. సరే, ప్రారంభిద్దాం."

" జావాలో రెండు ప్రధాన రకాలు ఉన్నాయి : స్ట్రింగ్ మరియు పూర్ణం . మేము స్ట్రింగ్స్/టెక్స్ట్‌ను స్ట్రింగ్‌లో నిల్వ చేస్తాము మరియు పూర్ణాంకాల (పూర్తి సంఖ్యలు) పూర్ణాంకంలో నిల్వ చేస్తాము. కొత్త వేరియబుల్‌ని ప్రకటించడానికి, మీరు దాని రకం మరియు పేరును పేర్కొనాలి. పేరు ఉండకూడదు ఏదైనా ఇతర వేరియబుల్స్ మరియు/లేదా ఫంక్షన్‌ల పేర్లతో సమానం."

ఉదాహరణ 1, కోడ్: వివరణ
String s;
కొత్త వేరియబుల్ sప్రకటించబడింది. ఇది వచనాన్ని నిల్వ చేయగలదు.
int i;
కొత్త వేరియబుల్ i, ప్రకటించబడింది. ఇది పూర్ణాంకాలను నిల్వ చేయగలదు.

"మీరు వాటిని ప్రకటించినప్పుడు వేరియబుల్స్‌కు విలువలను కేటాయించవచ్చు."

ఉదాహరణ 2, కోడ్: వివరణ
String s = "Ellie";
వేరియబుల్ sస్ట్రింగ్‌ను నిల్వ చేస్తుంది "Ellie".
int i = 5;
వేరియబుల్ i5 సంఖ్యను నిల్వ చేస్తుంది.

"ఒక వేరియబుల్‌కు కొత్త విలువను కేటాయించడానికి, మేము గుర్తును ఉపయోగిస్తాము =. దీనిని 'అసైన్‌మెంట్ ఆపరేటర్' అని కూడా పిలుస్తారు . అసైన్‌మెంట్ అంటే వేరియబుల్‌లో మరొక వేరియబుల్ నుండి లేదా అనేక వేరియబుల్స్ నుండి గణించబడిన ఒక విలువను వేరియబుల్‌లో ఉంచడం .

ఉదాహరణ 3, కోడ్: వివరణ
int a = 5;
వేరియబుల్ a5 విలువను నిల్వ చేస్తుంది.
int b = 6;
వేరియబుల్ b6 విలువను నిల్వ చేస్తుంది.
int c = a + b;
వేరియబుల్ c11 విలువను నిల్వ చేస్తుంది.

"పాత విలువను భర్తీ చేసే కొత్త విలువను గణించడానికి వేరియబుల్ విలువను ఉపయోగించవచ్చు."

ఉదాహరణ 4, కోడ్: వివరణ
int a = 2;
ఇప్పుడు a2కి సమానం
int b = 3;
ఇప్పుడు b3కి సమానం
a = a + b;
ఇప్పుడు a5కి సమానం
b = b + 1;
ఇప్పుడు b4కి సమానం

"మీరు తీగలను గుర్తుతో విలీనం చేయవచ్చు +:"

ఉదాహరణ 5, కోడ్: వివరణ
String s1 = "Rain";
String s2 = "In";
String s3 = s1 + s2 + "Spain";
వేరియబుల్ s3స్ట్రింగ్‌ను నిల్వ చేస్తుంది"RainInSpain"

"కొన్నిసార్లు, ఒకటి లేదా అంతకంటే ఎక్కువ ఖాళీలను కలిగి ఉండే స్ట్రింగ్‌లు ఉపయోగపడతాయి:"

ఉదాహరణ 6, కోడ్: వివరణ
String s1 = "My favorite movie is";
String s2 = "Route";
int roadNumber = 66;
String text = s1 + " " + s2 + " " + roadNumber;
textదుకాణాలు"My favorite movie is Route 66"

"మనం స్క్రీన్‌పై టెక్స్ట్ మరియు వేరియబుల్‌లను ఎలా ప్రదర్శిస్తామో చూద్దాం:"

ints మరియు స్ట్రింగ్స్ పరిచయం - 1
ఉదాహరణ 7, కోడ్:
1
System.out.println("A man's gotta do what a man's gotta do");
2
String s = "A man's gotta do what a man's gotta do";
System.out.println(s);

"మార్గం ద్వారా, డియెగో మీకు కొన్ని వ్యాయామాలు చేయమని నన్ను అడిగాడు:"

1
టాస్క్
Java Syntax,  స్థాయిపాఠం
లాక్ చేయబడింది
CodeGym. Learn once - use anywhere
Here's a riddle: "Written once, it runs everywhere". Answer: A Java program. That's the right answer, because Java is logical and properly structured. Let's rephrase this slogan for students: "learn once, use anywhere!" Here's a little task on this topic: write a program that displays a useful phrase 10 times on the screen.
1
టాస్క్
మాడ్యూల్ 1,  స్థాయిపాఠం
లాక్ చేయబడింది
Uh... Happy New Year!
What if you don't abandon your studies? What if you keep on completing tasks and working through the lessons? If you do, then by next New Year's, which is at least three months away, you can celebrate the new year as a real programmer! That's the dream. But for now, let's go to work. Let's remove the unnecessary comments and display some New Year's well-wishes.
1
టాస్క్
Java Syntax,  స్థాయిపాఠం
లాక్ చేయబడింది
Let's change the code
Editing someone else's code is sometimes more difficult than writing your own. You can trust the experience of experts at the secret CodeGym center. That's why our curriculum includes tasks about fixing code. For now, let's open our textbook, wrap our brains around some simple code, and then change the code so that the variable name takes the value "Amigo".
1
టాస్క్
Java Syntax,  స్థాయిపాఠం
లాక్ చేయబడింది
A few more corrections
Articles such as "1001 Tips for Becoming a Great Programmer" almost always include a phrase like "Someone else's code will teach you how to write your own". A programmer seldom works alone, so this advice is the plain truth. You won't get anywhere by ignoring it. We have to get used to teamwork and fixing other people's code.