• + 0 comments

    other way to understand in java

    public class Solution {
    	public static void main(String[] args) {
            // Create a Scanner object to read input from stdin.
    		Scanner scan = new Scanner(System.in); 
    		
    		// Read a full line of input from stdin and save it to our variable, inputUser.
    		String inputUser = scan.nextLine(); 
    
    		// Close the scanner object, because we've finished reading 
            // all of the input from stdin needed for this challenge.
    		scan.close(); 
          
    		// Print a string literal saying "Hello, World." + the variable inputUser to stdout.
    		System.out.println("Hello, World.\n" + inputUser);
            
          
    	    // TODO: Write a line of code here that prints the contents of inputUser to stdout.
    	}
    }