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
22 lines (18 loc) · 691 Bytes
/
Copy pathDate.java
File metadata and controls
22 lines (18 loc) · 691 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
public class Date {
public static void main(String[] args) {
String day = "Monday";
int date = 14;
String month = "August";
int year = 2017;
printAmerican(day, date, month, year);
printEuropean(day, date, month, year);
}
public static void printAmerican(String day, int date, String month, int year) {
System.out.print("Today's date (American format) is: ");
System.out.println(day + ", " + month + " " + date + ", " + year);
}
public static void printEuropean(String day, int date, String month, int year) {
System.out.print("Today's date (European format) is: ");
System.out.println(day + " " + date + " " + month + " " + year);
}
}