Skip to Main Content

New to Java

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Java constructors

807601Dec 15 2007 — edited Dec 15 2007
I have been set the following exercise:

A computer program is to be developed to be used in clocks. Here is a class definition for this program
public class Time
{
public int hour;
public int minute;
public boolean isMorning;
}
Enhance the above class definition by providing two constructors: one that allows a time to be set to given values; and another that sets a default time of 1 O?clock in the morning.

Doing all the code is no problem, what i could do with some help with is the layout of the classes etc for my constructors. I dont know if that is clear.
What i need help with is setting up my constructors relevant to this program. If you understand the jist, i would be greatful for some help.
cheers
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jan 12 2008
Added on Dec 15 2007
8 comments
194 views