Here's my main file
The line with System.out.println is wrong. It is my attempt to call up the printDate method which is in a different file.public static void main(String[] args) { // Born Aug 21, 1996 int birthYear = 1996; int birthDay = 21; int birthMonth = 8; Date date1 = new Date(); date1.year = birthYear; date1.month = birthMonth; date1.day = birthDay; System.out.println (printDate(date1)); Date date2 = new Date(2013, 4, 9); System.out.println (d.printDate.date2); }
Here's is my code for the different file
public class Date { int year, month, day; // "Empty" Constructor public Date() { } // Construct date object using year, month, and day public Date(int year, int month, int day) { this.year = year; this.month = month; this.day = day; } public static void printDate (Date d) { System.out.println (d.month + " " + d.day + ", " + d.year); } }