Question 1
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.
Question 2
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 represents correct implementation code for the constructor with parameters?
Correct Answer:
hrs = h; mins = m; secs = s;
Explanation:
Correct answer: hrs = h; mins = m; secs = s;
Question 3
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 */ } } A client class has a display method that writes the time represented by its parameter: /** Outputs time t in the form hrs:mins:secs. * @param t the time */ public void display(Time t) { /* method body */ } Which of the following are correct replacements for / method body /? I Time T = new Time(h, m, s); System.out.println(T); II System.out.println(t.hrs + ":" + t.mins + ":" + t.secs); III System.out.println(t);
Correct Answer:
III only
Explanation:
Correct answer: III only
Question 4
Which statement about parameters is false?
Correct Answer:
Two overloaded methods in the same class must have parameters with different names.
Explanation:
Correct answer: Two overloaded methods in the same class must have parameters with different names.
Question 5
Questions 5–11 refer to the following Date class declaration: public class Date { private int day; private int month; private int year; public Date() //default constructor { ... } public Date(int mo, int da, int yr) //constructor { ... } public int month() //returns month of Date { ... } public int day() //returns day of Date { ... } public int year() //returns year of Date { ... } //Returns String representation of Date as "m/d/y", e.g. 4/18/1985. public String toString() { ... } } Which of the following correctly constructs a Date object in a client class?
Correct Answer:
Date d = new Date(2, 13, 1947);
Explanation:
Correct answer: Date d = new Date(2, 13, 1947);
Question 1
Exam overview

About this Exam

The Advanced Placement (AP) Computer Science A course offers high school students an introductory college-level foundation in computer science, specifically focusing on object-oriented programming using Java. Unit 2 of this course, centered on Using Objects, is a fundamental building block. It covers crucial concepts like understanding classes, creating objects (instances), calling methods, and working with the documentation for classes. This course and its culminating exam are designed for ambitious high school students seeking to earn college credit, placement, or both, while developing critical thinking and problem-solving skills through programming. Mastering Unit 2 is essential for success in later units and the final AP exam.

More details

Additional Information

What the Course Entails and Exam Details

This unit transitions students from understanding basic data types to the powerful paradigm of object-oriented programming. The core topics covered in Unit 2 include understanding how objects store data and interact with each other. Students will learn the relationship between a class and an object, which is often described as a blueprint versus the actual structure. Key skills developed include identifying and implementing constructors for creating objects, understanding parameters and return types, and utilizing methods to define behavior. Additionally, students gain experience interpreting documentation (API) to effectively use pre-existing classes, which is a vital skill for real-world software development.


What to Expect in the Final Exam

It's important to understand that Unit 2 is not tested as a separate exam, but its concepts are heavily integrated throughout the main AP Computer Science A final exam administered in May. The final exam is a comprehensive assessment lasting three hours, divided into two distinct sections. Section I is a 90-minute multiple-choice section containing 40 questions, often testing conceptual understanding, code analysis, and logic derived directly from units like Unit 2. Section II is a 90-minute free-response section requiring students to write Java code by hand to solve programming problems, which frequently requires creating and manipulating objects based on problem descriptions.


How to Study and Exam Centers

Effective preparation for the AP Computer Science A exam requires a combination of strong conceptual understanding and extensive hands-on practice. For Unit 2 specifically, you should focus on writing small Java programs that create and use objects from various classes. Practice interpreting provided class documentation (like the AP Java Subset documentation provided on the exam) to use methods correctly. Utilize official College Board resources, including AP Classroom, where you can access topic questions, progress checks, and practice exams that mirror the actual test format. To take the official AP exam, you must register through your high school's AP coordinator. The exams are typically administered at your high school or an authorized local testing center in May.


Job Opportunities from the Course

A strong performance on the AP Computer Science A exam and the completion of the course can significantly accelerate your path toward many in-demand career opportunities in the technology sector. The foundational knowledge and problem-solving skills gained are directly applicable to numerous roles, including:

  • Software Engineer

  • Java Developer

  • Web Developer (Back-End)

  • Data Scientist

  • Systems Analyst

  • Computer Programmer

  • QA (Quality Assurance) Engineer

  • Mobile Application Developer

Quiz information

Frequently Asked Questions

The complete question count is available after full access is unlocked.
No fixed duration is currently configured for this quiz.
Question explanations are included where they are available in the quiz content, helping you review the reasoning after answering.
Yes. You can retake the practice test again as you continue studying during your available access period.
After your access is confirmed, you can continue into the complete practice exam from this quiz flow.
Unless explicitly stated otherwise, this page provides independent practice material for study and exam preparation and is not the official examination itself.
Keep studying

Related Questions