Monday, January 16, 2017

Think Java - Chapter 2 Exercise 2: My Finished Code

public class Date {

public static void main(String[] args) {
System.out.println("Hello World!");

String day = "Monday";
int date = 16;
String month = "January";
int year = 2017;
System.out.println("American format:");
System.out.println(day + " " + month + " " + date + ", " + year);

System.out.println("European format:");
System.out.println(day + " " + date + " " + month + ", " + year);
}

}

No comments:

Post a Comment