Answers for "java nextline"

9

java string next line

// its \r\n
String a = "Hello, "
String b = "there!"
System.out.println(a+b);//returns Hello, there
System.out.println(a+"\r\n"+b);//returns Hello, 
//there! //it will be on the next line!
Posted by: Guest on July-08-2020
1

java read next line

Scanner scanner = new Scanner(new File("filename"));
while (scanner.hasNextLine()) {
   String line = scanner.nextLine();
   // process the line
}
Posted by: Guest on May-06-2020

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language