I\'m writing a program which allows the user to input his data then outputs it. Its 3/4 correct but when it arrives at outputting the address it only prints a word lets say
Below is the sample code to read a line in Standard input using Java Scanner class.
import java.util.Scanner;
public class Solution {
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
String s = scan.nextLine();
System.out.println(s);
scan.close();
}
}
Input:
Hello World
Output:
Hello World