Non-static variables used in a non-static method but doesn't work
Hi everyone. I have two classes in two .java files (DateDriver) and (DateAD)
Here are the variables declared in the DateAD class :
publicshort dayOfWeek = 0;
publicshort dayOfMonth = 0;
publicshort dayOfYear = 0;
publicshort month;
publicshort year;
And here is what I am trying to do with them from the DateDriver class
publicclass DateDriver
{
publicvoid main(String[] args)
{
DateAD aDay =new DateAD();
System.out.println("The Date Is : " + DateAD.dayOfWeek +", " + DateAD.dayOfMonth +" " + DateAD.month +", " + DateAD.year);
}
I am getting an error "non-static variable __ cannot be referenced from a static context" for all 4 of the variables I'm using in the println's argument. Any ideas on how I can fix these?
Thanks!
Message was edited by:
ApRiX

