-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlecture4_time.java
More file actions
29 lines (24 loc) · 806 Bytes
/
lecture4_time.java
File metadata and controls
29 lines (24 loc) · 806 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
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
System.out.println("enter a number for hour: ");
Scanner hour = new Scanner(System.in);
int h1 = hour.nextInt();
System.out.println("enter a number for minute: ");
Scanner minute = new Scanner(System.in);
int m1 = minute.nextInt();
System.out.println("enter a number for second: ");
Scanner second = new Scanner(System.in);
int s1 = second.nextInt();
Time t1= new Time();
Time t2 = new Time();
Time t3 = new Time();
Time t4 = new Time();
Time t5 = new Time();
t1.setHour(h1);
t2.setMinute(m1);
t3.setSecond(s1);
t4.toUniversalString();
t5.toString();
}
}