I'm new to java and having a really hard time understanding what I am doing wrong here. I'm still having a hard time fully understanding abstract classes, and interfaces so I think that's where my problem is coming from.
I'm trying to create a class that will allow me to create party objects, I'm able to instantiate all variables except for the date. Here is what I have so far:
public class Main {
public static void main(String[] args) {
...
Party joes = new Party("Joes party", "Joe", "Joe's Place",
new GregorianCalendar(2012,10,10));
joes.printParty();
}
}
public class Party {
//attributes of party
private String partyName;
private String partyHost;
private String location;
private GregorianCalendar partyTime;
public Party(String partyName, String partyHost, String location, GregorianCalendar partyTime){
this.partyName = partyName;
this.partyHost = partyHost;
this.location = location;
this.partyTime = partyTime;
}
}
When I print this out I get:
"Joes party is going to be hosted by Joe at Joe's Place on:
java.util.GregorianCalendar[time=?,areFieldsSet=false,areAllFieldsSet=false,lenient=true..."