Search Header Logo

APCSA Unit 5 refresher

Authored by Thomas Wright

Computers

9th Grade

Used 2+ times

APCSA Unit 5 refresher
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

23 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

The return type of an accessor method

is void

must be a user defined class

must be a primitive

must match the type of the instance variable being accessed

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

The purpose of an accessor method is

to modify an instance variable

to return the value of an instance variable

to return the values of all of the instance variables

to allow the user to have direct access to an instance variable

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following is true?

Both primitives and objects are returned by value.

Both primitives and objects are returned by reference.

Primitives are returned by value. Objects are returned by reference.

Objects are returned by value. Primitives are returned by reference.

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Accessors and mutators are used to

Allow private data to be accessed outside of the class and be safely modified.

Allow users to access and modify any of the class’s data in any way they wish.

Prevent users from manipulating private data.

Allow public data to be accessed and safely modified.

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

The return type of a mutator method

is usually void

must match the type of of the instance variable being mutated

must be a primitive

must be a user defined class

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following is a benefit of using a mutator method?

Only methods outside of the class can change an instance variable’s value

Mutator methods can verify the new value is a valid value for the instance variable

The user can change all of the instance variables using the same mutator method

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Classes’ access specifier is generally set to

private to prevent any user from accessing and modifying any instance variables.

private so that only certain users can create objects of the class.

public so that all data and methods are accessible by any user.

public so that any user can create and use objects of the 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?