Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Created by Cody Smith
- //This program takes the dates and flips the order it prints out
- package date_array;
- class MyDate {
- public int day;
- public String month;
- public int year;
- public MyDate(String month, int day, int year)
- {
- this.day = day;
- this.month = month;
- this.year = year;
- }
- public String toString()
- {
- return (month + " " + day + " " + year);
- }
- public class DateArray {
- MyDate[] dateArr = new MyDate[4];{
- dateArr[0] = new MyDate("May", 16,1984);
- dateArr[1] = new MyDate("November", 14,1978);
- dateArr[2] = new MyDate("September", 21,1980);
- dateArr[3] = new MyDate("July", 3,1987);
- }
- public void main(String[] args) {
- MyDate[] dateArr = new MyDate[4];
- dateArr.toString();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement