Lesson 3 of 34
Scanner से Input पढ़ना
8 min 20 XP
User से values हम Scanner से पढ़ते हैं। सबसे ऊपर import java.util.Scanner; लिखें। Run दबाने से पहले values को Input box में टाइप करें।
Example: edit me and press Run
Output Loading Java (first time takes a few seconds)
Press Run to see the result here.nextInt() पूर्ण संख्या पढ़ता है, nextDouble() दशमलव, next() एक शब्द (space तक) और nextLine() पूरी लाइन। Spaces या नई लाइनों से अलग की गई values एक-एक करके पढ़ी जाती हैं।
Example: edit me and press Run
Output Loading Java (first time takes a few seconds)
Press Run to see the result here."Sum = " + a + b लिखने पर 1230 print होता है! (a + b) को brackets में रखें ताकि संख्याएँ पहले जुड़ें।