class ClockType { public void setTime(int hour, int min, int sec); public int ge
ID: 3675237 • Letter: C
Question
class ClockType
{
public void setTime(int hour, int min, int sec);
public int getTime();
public void printTime();
public void incrementSeconds();
private int hr;
public int min;
public int sec;
}
7
3
10
4
An average of 5 because (7 + 3) / 2 = 5
class ClockType
{
public void setTime(int hour, int min, int sec);
public int getTime();
public void printTime();
public void incrementSeconds();
private int hr;
public int min;
public int sec;
}
Explanation / Answer
The number of methods in class ClockType is 4.
They are
public void setTime(int hour, int min, int sec);
public int getTime();
public void printTime();
public void incrementSeconds();
-----------------------------------------------------------------------------
Method definition:
A method has return type methodName and arguments list in paranthesis.
Methods are used to set or edit the values of the class private members .
In class ClockType the four methods will satisfy the method definition.
Therefore , the correct option is 4
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.