Search Header Logo

APCSA Unit 2 Quiz

Authored by Katherine Valenti

Computers

12th Grade

APCSA Unit 2 Quiz
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

26 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

In Java, what is a class defined as?

A) A collection of objects

B) A type of data structure

C) A programmer-defined blueprint from which objects are created

D) A function that performs operations

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is an object in Java?

A) A reference to a class

B) A method within a class

C) An instance of a class

D) A variable type

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is an instance variable?

A) A type of method that performs an action in a class.

B) A variable defined in a class that represents an attribute of an object.

C) A piece of data passed into a method when it is called.

D) A variable that is shared among all instances of a class.

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What does the 'int' in the declaration 'private int xLocation;' represent?

A) A sequence of characters, like "purple"

B) Decimal numbers, like 2.5 or 92.81

C) Whole numbers, like 7 or 6784

D) True or false values

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the visibility of the instance variable 'xLocation' as declared in 'private int xLocation;'?

A) Public

B) Protected

C) Default

D) Private

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What happens to instance variables when an object is instantiated?

A) They are shared with other instances of the same class.

B) They are deleted and must be redefined.

C) Each object gets its own copy of the instance variables.

D) They become static and unchangeable.

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is inheritance in object-oriented programming?

A) A method by which one class receives properties from another class.

B) A principle where a subclass inherits the attributes and behaviors of a superclass.

C) The process by which a function calls itself.

D) A technique for encapsulating data within a class.

Access all questions and much more by creating a free account

Create resources

Host any resource

Get auto-graded reports

Google

Continue with Google

Email

Continue with Email

Classlink

Continue with Classlink

Clever

Continue with Clever

or continue with

Microsoft

Microsoft

Apple

Apple

Others

Others

Already have an account?