68.9k views
1 vote
You are given a class named clock that has one int instance variable called hours. write a constructor with no parameters for the class clock. the constructor should set hours to 12.

1 Answer

4 votes
in java it would be

public clock()
{
hours = 12;
}
User Joe Caruso
by
8.0k points