Using Objects in AP Computer Science A
Objects are stored as what type of data?
Primitive types, holding the actual value directly.
Reference types, holding a memory location.
Abstract types, holding no value.
Integer types, holding numerical values.
Consider the following code snippet:
java
public class Dog {
String name;
int age;
public Dog(String name) {
this.name = name;
this.age = 3;
}
public Dog(String name, int age) {
this.name = name;
this.age = age;
}
public static void main(String[] args)...
myDog.age = 0, yourDog.age = 0
myDog.age = 3, yourDog.age = 3
myDog.age = 5, yourDog.age = 3
myDog.age = 3, yourDog.age = 5
Which of the following best describes the relationship between a class and an object?
A class is an instance of an object.
An object is an instance of a class.
A class and an object are the same thing.
A class is a collection of objects.
What keyword is used to create a new object in Java?
instance
object
new
create
Approximately what percentage of the AP Computer Science A exam focuses on the concept of using objects?
1-2%
5-7.5%
20-25%
50%
What is the purpose of passing parameters to a constructor when creating an object?
To define the class of the object.
To specify the methods the object can call.
To initialize the object's attributes.
To destroy the object after creation.

How are we doing?
Give us your feedback and let us know how we can improve