forked from AllenDowney/ThinkJavaCode
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDate.java
More file actions
28 lines (21 loc) · 652 Bytes
/
Date.java
File metadata and controls
28 lines (21 loc) · 652 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
//Exercise 2-2.
public class Date
{
public static void main (String[] args)
{
String day = "Monday";
int date = 16;
String month = "April";
int year = 2018;
System.out.println(day);
System.out.println(date);
System.out.println(month);
System.out.println(year);
System.out.println();
System.out.println("American Format:");
System.out.println(day + ", " + month + " " + date + ", " + year);
System.out.println();
System.out.println("European Format:");
System.out.println(day + " " + date + " " + month + " " + year);
}
}