We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
Feel free to post your output, in order to debug it :)
the correct code could be like the following:
// 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, inputString.
String inputString = 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." to stdout.
// add the '\n' new line parameter then append the string
// from the Scanner
System.out.println("Hello, World." + "\n" + inputString);
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Day 0: Hello, World.
You are viewing a single comment's thread. Return to all comments →
Feel free to post your output, in order to debug it :)
the correct code could be like the following:
// 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, inputString. String inputString = 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." to stdout. // add the '\n' new line parameter then append the string // from the Scanner System.out.println("Hello, World." + "\n" + inputString);