00 Day : Hello, World.

zkpk
Code-30-Days
Published in
1 min readJun 14, 2016

Ohayo!

I want to give myself an opportunity to practice mastery …so I set myself a small challenge to learn one programming concept &/or framework a day and C-O-D-E it.

I am using Java and Today’s concept is as follows

…save a line of input (using stdin) to a variable

…print 1st line “Hello, World.”

…print 2nd line <variable>

Code :

import java.io.*;
import java.util.*;
import java.text.*;
import java.math.*;
import java.util.regex.*;
public class Solution {
public static void main(String[] args) {
Scanner scan = new Scanner(System.in); // use the Scanner class to read from stdin
String inputString = scan.nextLine(); // read a line of input and save it to a variable
scan.close(); // close the scanner

// Your first line of output goes here
System.out.println(“Hello, World.”);

// Write the second line of output
System.out.println(inputString);
}
}

Input :

Ohayo!

Output :

Hello, World.
Ohayo!

Thank you HackerRank

Follow me PK Rasam

--

--