java string next line
// its rn
String a = "Hello, "
String b = "there!"
System.out.println(a+b);//returns Hello, there
System.out.println(a+"rn"+b);//returns Hello,
//there! //it will be on the next line!
java string next line
// its rn
String a = "Hello, "
String b = "there!"
System.out.println(a+b);//returns Hello, there
System.out.println(a+"rn"+b);//returns Hello,
//there! //it will be on the next line!
what is the difference between sc.nextLine() and sc.next() in java
Their differences are...
next() can read the input only till the space. It can't read two words separated by space. Also, next() places the cursor in the same line after reading the input.
nextLine() reads input including space between the words (that is, it reads till the end of line n). Once the input is read, nextLine() positions the cursor in the next line.
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us