SE_19_Lesson_4: Delimiters

Delimiter - is white space that separates input data.

Scanner skips delimiter.

*** Scanner.nextLine - it reads the current line.

Elave olaraq Scanner.nextLine iwletmeliyikki problem yawamayaq.

Scanner sc = new Scanner(System.in);
System.out.println("Please enter a number:");
int num = sc.nextInt();
System.out.println(num);

sc.nextLine();
System.out.println("Please enter a sentence:");
String sentence = sc.nextLine();
System.out.println(sentence);


Eger Scannerden reqemsal melumat isteyirikse ve ondan sonra String isteyirikse, o zaman bow sc.nextLine(); yazmaliyiq 





Комментарии

Популярные сообщения из этого блога

Lesson1: JDK, JVM, JRE

SE_21_Lesson_11: Inheritance, Polymorphism

SE_21_Lesson_9: Initialization Blocks, Wrapper types, String class