I don't understand constructors. Can anybod help?
The question is:
You are given a classnamed Clock that has one intinstance variable called hours . Write a constructor with no parameters for the class Clock . The constructor should set hours to 12 .
I think the answer is:
hours=12;
but I'm worng. Please help.
P.S. One more question:
How do you compare Strings. I think you do:
compareTo(string1,string2)>1;
Am i correct? :rolleyes:
Thanks