Hey everybody,
I have been learning Java onlin for about a week now.
here is the program I am trying to get to work
It wont compile, I get 14 error messages.class OfficeLights { char Status = Off; char Status = On; void changeStatus(char newValue) { status = newValue; } void printStates() { System.out.println("Status:"+Status); } } class CoffeeMug { char lid = Open; char Lid = Closed; char Contents = Empty; char Contents = Coffee; char Contents = Tea; void changeLid(char newValue) { lid = newValue; } void changeContents(char newValue) { Contents = newValue; } void printStates() { System.out.println("lid:"+lid+" Contents:"+Contents); } } class OfficeLightsCoffeeMug { public static void main(String[] JD) { OfficeLights light1 = new OfficeLights(); light1.changeStatus(On); light1.printStates(); CoffeeMug mug1 = new CoffeeMug(); mug1.changeLid(Closed); mug1.changeContents(Coffee); mug1.printStates(); } }
I have attached a screenshot of the errors I am getting when I try to compile.
Any advice on this particular program &| some newbie tips/advice in general would be very welcome,
Thanks!
P.S. I hope this is the right topic to post under, sorry if I commited a faux pas...