-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjava code
30 lines (23 loc) · 888 Bytes
/
java code
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
#This is a java code to Print an Integer entered by an user
#This is a java code to Print an Integer entered by an user
import java.util.Scanner;
public class HelloWorld1 {
public static void main(String[] args) {
// Creates a reader instance which takes
// Creates a reader instance which takes
// input from standard input - keyboard
Scanner reader = new Scanner(System.in);
System.out.print("Enter a number: ");
// nextInt() reads the next integer from the keyboard
int number = reader.nextInt();
// println() prints the following line to the output screen
System.out.println("You entered: " + number);
}
}
#This is a java code for Hello Word
#This is a java code for Hello Word
class HelloWorld {
public static void main(String[] args) {
System.out.println("Hello, World!");
}
}