-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathHello_world.text
More file actions
31 lines (22 loc) · 847 Bytes
/
Hello_world.text
File metadata and controls
31 lines (22 loc) · 847 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
/* save a line of input from stdin to a variable,
print Hello, World. on a single line, and
print the value of your variable on a second line */
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) {
// 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.
System.out.println("Hello, World.");
System.out.println(inputString);
}
}