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
24 lines (18 loc) · 736 Bytes
/
Date.java
File metadata and controls
24 lines (18 loc) · 736 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
public class Date {
public static void main(String[] args){
String day = "Wednesday";
String month = "May";
int date = 9;
int year = 2018;
printAmerican(day,date,month,year);
printEuropean(day,date,month,year);
}
public static void printAmerican(String day, int date, String month, int year){
//prints a date in American format
System.out.println("American format: " + day + ", " + month + " " + date + ", " + year + ".");
}
public static void printEuropean(String day, int date, String month, int year){
//prints a date in European format
System.out.println("European format: " + day + " " + date + " " + month + " " + year + ".");
}
}