Objects: Instances of Classes MCQ Practice

Question 1 of 10

Class OrchardBin is the blueprint for harvest crates. crate17 is the crate currently on dock 4. Which pairing is correct?

  1. A. OrchardBin is one crate; crate17 is the class library
  2. B. OrchardBin is the class; crate17 is one instance of that class
  3. C. crate17 is a primitive type; OrchardBin is its only allowed value
  4. D. crate17 is a superclass of OrchardBin because it already exists

Question 2 of 10

Why does AP CSA describe Object as the root of the class hierarchy?

  1. A. Every class is conceptually under Object, even when students do not write inheritance code.
  2. B. Only String objects have Object as a parent, and only after a student types extends.
  3. C. Object replaces all reference variables with primitives.
  4. D. Object is a required filename, not a class.

Question 3 of 10

A diagram shows Animal, then Bird as a more specific Animal, with Object above both. Students will not code extends. Which conclusion is valid?

  1. A. A Bird object is conceptually an Animal and an Object.
  2. B. Bird and Animal are two names for one required Java subclass the student must write.
  3. C. Object applies only to primitives in this diagram.
  4. D. Two Bird objects form a class hierarchy with each other.

Question 4 of 10

The table describes two ticket windows that already exist. Which statement is correct?

Reference Class lineLength
northWindow TicketWindow 9
southWindow TicketWindow 4
  1. A. northWindow is the superclass of southWindow.
  2. B. They cannot share a class because lineLength differs.
  3. C. They are two TicketWindow instances with independent lineLength values.
  4. D. The repeated class name means there is only one object.

Question 5 of 10

Reference kilnA currently names a PotteryWheel object. A programmer later writes PotteryWheel studioTool = kilnA. Does renaming through a second variable change the object’s class?

  1. A. Yes; studioTool becomes a new subclass automatically.
  2. B. No; both variables refer to the same PotteryWheel object.
  3. C. Yes; Java changes the object into Object only.
  4. D. No, because assignment copies every attribute into a primitive int.

Question 6 of 10

What is an object’s state in this topic?

  1. A. The current values of that instance’s attributes
  2. B. The name of the Java source file only
  3. C. The list of all classes in the JDK
  4. D. A required inheritance diagram the student must code

Question 7 of 10

What does a reference variable store?

  1. A. A copy of every attribute as stacked primitive values inside the variable
  2. B. A reference value that either refers to an object or is null
  3. C. The class bytecode instead of a value
  4. D. A required subclass name

Question 8 of 10

After this code, which description is correct?

Silo east = new Silo(40);
Silo west = new Silo(40);
  1. A. east and west must refer to the same object because 40 matches.
  2. B. east and west refer to two distinct Silo objects that happen to have the same grain amount.
  3. C. west stores null because a second new is ignored.
  4. D. Java converts west into a primitive 40.

Question 9 of 10

A bakery uses class Oven. After this code, what is true of heat if stoke increases the aliased oven’s temperature?

Oven deck = new Oven(350);
Oven heat = deck;
heat.stoke(25);
  1. A. deck still refers to 350 and heat refers to a different 375 oven.
  2. B. deck and heat refer to the same oven, now at 375.
  3. C. stoke copies 25 into heat as a primitive and leaves the oven unchanged.
  4. D. heat becomes null because methods consume the reference.

Question 10 of 10

Which line declares a Marquee reference that currently refers to no Marquee object?

  1. A. Marquee board = new Marquee();
  2. B. Marquee board = null;
  3. C. int board = null;
  4. D. Marquee board = "null";