AP Computer Science Unit 2 – Test Review Practice Questions

Access More Questions
Questions 1–3 refer to the Time class declared below: public class Time { private int hrs; private int mins; private int secs; public Time() { /* implementation not shown */ } public Time(int h, int m, int s) { /* implementation not shown */ } /** Resets time to hrs = h, mins = m, secs = s. */ public void resetTime(int h, int m, int s) { /* implementation not shown */ } /** Advances time by one second. */ public void increment() { /* implementation not shown */ } /** @return true if this time equals t, false otherwise */ public boolean equals(Time t) { /* implementation not shown */ } /** @return true if this time is earlier than t, false otherwise */ public boolean lessThan(Time t) { /* implementation not shown */ } /** @return a String with the time in the form hrs:mins:secs */ public String toString() { /* implementation not shown */ } } Which of the following is a false statement about the methods?
Correct Answer:
The Time class has three constructors.
Explanation:
Correct answer: The Time class has three constructors.

Access more questions from this quiz

Continue to AP Computer Science Unit 2 – Test Review Practice Questions for more practice questions and the full quiz experience.

Access More Questions