HackerRank 30 Days of Code - 00. Hello, World
post_snippet Problem To complete this challenge, you must save a line of input from stdin to a variable, print 'Hello, World.' on a single line, and finally print the value of your variable on a second line. INPUT A single line of text denoting inputString (the variable whose contents must be printed). Welcome to 30 Days of Code! OUTPUT Print 'Hello, World.' on the first line, and the contents of inputString on the second line. Hello, World.
Welcome to 30 Days of Code! Solution (Java) import java.util.Scanner;
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 full line of input and assign it to variable 'inputString'.
String inputString = scan.nextLine();
// close the scanner object after finished reading lines.
scan.close();
// Print a string literal saying "Hello, World." to stdout.
System.out.printl…