-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathProgram01.java
43 lines (25 loc) · 882 Bytes
/
Program01.java
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
32
33
34
35
36
37
38
39
40
41
42
43
import java.util.Scanner;
public class Program01 {
public static void main(String[] args){
System.out.println("Hello World");
String name = "Yogesh";
System.out.println(name);
int a = 45;
float b = 45.33f;
boolean isAdult = false;
System.out.println(a);
System.out.println(b);
System.out.println(isAdult);
//Taking user input in Java
Scanner scan = new Scanner(System.in);
System.out.println("What is your name ?");
String input = scan.nextLine();
System.out.println(input);
// Here scan is a object and input is a variable
// for taking integer input
System.out.println("Enter Your age : ");
int number = scan.nextInt();
System.out.println("Your age is " + number);
//continue form 1:14:54;
}
}