"நீண்ட காலத்திற்கு முன்பு, கணினிகள் உரையை மட்டுமே காட்ட முடியும். விசைப்பலகையில் இருந்து உள்ளீட்டைப் பெற்ற பிறகு நிரல்கள் திரையில் தரவைக் காண்பிக்கும். இது 'கன்சோல் பயனர் இடைமுகம்' அல்லது வெறுமனே 'கன்சோல்' என்று அழைக்கப்படுகிறது. ஒரு சாளர இடைமுகம் கன்சோலுக்கு மாற்றாகும். இந்த வகையான இடைமுகம், பயனர் ஒன்று அல்லது அதற்கு மேற்பட்ட விண்டோக்கள் மூலம் நிரலுடன் தொடர்பு கொள்கிறார். நாங்கள் எப்படி நிரல் செய்வது என்பதைக் கற்றுக் கொண்டிருப்பதால், கன்சோலில் வேலை செய்வதன் மூலம் தொடங்குவோம்."

"எல்லாம் சரி."

"உரை கன்சோலில் (திரையில்) தொடர்ச்சியாக, வரிக்கு வரி காட்டப்படும். உரை விசைப்பலகையைப் பயன்படுத்தி உள்ளிடப்படுகிறது. தவறுகளைத் தவிர்க்க, விசைப்பலகை உள்ளீடு திரையில் காட்டப்படும். சில சமயங்களில் மனித பயனரும் நிரலும் மாறி மாறி வருவது போல் தெரிகிறது . திரையில் விஷயங்களை எழுதுகிறேன். "

"நீங்கள் திரையில் உரையைக் காண்பிக்க System.out.print () முறையைப் பயன்படுத்தலாம் . இந்த முறை வெறுமனே உரையைக் காண்பிக்கும், System.out.println () உரையைக் காண்பிக்கும் மற்றும் கர்சரை அடுத்த வரிக்கு நகர்த்துகிறது."

குறியீடு விளைவாக
System.out.print("Rain");
System.out.print("In");
System.out.print("Spain");
ஸ்பெயின் மழை
System.out.print("Rain");
System.out.println("In");
System.out.print("Spain");

ஸ்பெயினில் மழை
System.out.println("Rain");
System.out.println("In");
System.out.println("Spain");

ஸ்பெயினில் மழை
_

"உரையின் பிட்களைத் தனித்தனியாக வைத்திருக்க, ஒரு இடத்தைச் சேர்க்க வேண்டும். எடுத்துக்காட்டாக:"

குறியீடு விளைவாக
int a = 5, b = 6;
System.out.print(a);
System.out.print(b);
56
int a = 5, b = 6;
System.out.print(" " + a + " " + b);
 5 6
int a = 5, b = 6;
System.out.print("The sum is " + (a + b));
The sum is 11

"அறிந்துகொண்டேன்"

"இது எதையும் திரையில் காண்பிக்க உங்களை அனுமதிக்கிறது: அனைத்து ஜாவா பொருட்களையும் சரமாக மாற்றலாம். அனைத்து ஜாவா வகுப்புகளும் ஆப்ஜெக்ட் வகுப்பிலிருந்து பெறப்படுகின்றன, இதில் toString() முறை உள்ளது. நீங்கள் ஒரு பொருளை ஒரு பொருளாக மாற்ற விரும்பும் போது இந்த முறை அழைக்கப்படுகிறது. லேசான கயிறு."

குறியீடு விளக்கம்
Cat cat = new Cat("Oscar");
System.out.println("The cat is " + cat);
இந்த மூன்று எடுத்துக்காட்டுகளும் சமமானவை.
Cat cat = new Cat("Oscar");
System.out.println("The cat is " + cat.toString());
Cat cat = new Cat("Oscar");
String catText = cat.toString();
System.out.println("The cat is " + catText);
3
பணி
Java Syntax,  நிலை 3பாடம் 3
பூட்டப்பட்டது
Display right away
Programming isn't always difficult. Sometimes you need to do simple tasks. And the more similar tasks you have to do, the more you want to automate them. Let's implement one more method. Ultimately, objects without methods don't do anything. We'll pass the string s to the method, which will then display it on the screen.

"ஆனால் எனது நிரல் ' பூனை com.codegym.lesson3.Cat@1fb8ee3 ' என்று காட்டப்பட்டது. உலகில் அதன் அர்த்தம் என்ன?"

"Object class இன் நிலையான toString() முறையானது வர்க்கப் பெயர் மற்றும் பொருளின் நினைவக முகவரி (ஹெக்ஸாடெசிமல் வடிவத்தில்) அடங்கிய சரத்தை வழங்குகிறது ."

"உஹ்-ஹூ. அப்படிப்பட்ட ஒரு முறையால் என்ன நன்மை கிடைக்கும்?"

"நீங்கள் உங்கள் வகுப்பில் toString() இன் சொந்த செயலாக்கத்தை எழுதலாம். பிறகு அதுதான் முறை என்று அழைக்கப்படும்."

"அப்படியா? சரி."

"டியாகோவிடமிருந்து சில பணிகள் இங்கே உள்ளன."

3
பணி
Java Syntax,  நிலை 3பாடம் 3
பூட்டப்பட்டது
Currency exchange
Loan sharking, sales, banking: do you have a backup plan if programming doesn't work out? No? In that case, let's help traders and financiers with our top-notch programs. First, we'll organize a currency exchange: write a program that converts euros to dollars at a given exchange rate.
3
பணி
Java Syntax,  நிலை 3பாடம் 3
பூட்டப்பட்டது
Task with percentages
If you weren't afraid of problems with percentages in school, then this problem won't scare you either. But if you do suddenly find yourself afraid, it's time to face your fear and realize that this is actually a simple and pleasant topic. Let's implement a method that increases the passed integer by 10 percent.
1
பணி
Java Syntax,  நிலை 3பாடம் 3
பூட்டப்பட்டது
Code entry
Your attention, please! Now recruiting code entry personnel for CodeGym. So turn up your focus, let your fingers relax, read the code, and then... type it into the appropriate box. Code entry is far from a useless exercise, though it might seem so at first glance: it allows a beginner to get used to and remember syntax (modern IDEs seldom make this possible).