Unit 1

Unit 1

11th Grade

14 Qs

quiz-placeholder

Similar activities

CS A Unit 1 Review

CS A Unit 1 Review

Unit 1 CSA Code

Unit 1 CSA Code

Java Inheritance and Method Quiz

Java Inheritance and Method Quiz

AP CSA Unit 1 Review

AP CSA Unit 1 Review

Java Classes Mastery Quiz

Java Classes Mastery Quiz

AP CSA | U1: Object-Oriented Programming By Mr. Benvenuto

AP CSA | U1: Object-Oriented Programming By Mr. Benvenuto

Object Oriented Programming Unit Quiz

Object Oriented Programming Unit Quiz

Unit 1

Unit 1

Assessment

Quiz

Computers

11th Grade

Medium

Created by

JOYCE PACHECO

Used 4+ times

FREE Resource

AI

Enhance your content in a minute

Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...

14 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 5 pts

A Painter object called myPainter is facing north. Consider the following code segment.

while (!myPainter.isFacingSouth()) { myPainter.turnLeft(); }

myPainter.turnLeft();

myPainter.turnLeft();

The effect of this code is that the myPainter object is now:

facing north

facing east

facing west

facing south

2.

MULTIPLE CHOICE QUESTION

30 sec • 5 pts

Which of the following is a TRUE statement about constructors in Java?

A.   The constructor contains all of the methods that an object can utilize.

B.   Constructors should be made private to keep all information safe and secure.

C.   The constructor should not have the same name as the class.

D.   In inheritance, the parent class should always contain the keyword super.

E.   The constructor is used to create objects of a class.

A

D

C

E

B

3.

MULTIPLE CHOICE QUESTION

30 sec • 5 pts

A Painter object called myPainter is initially facing east. Consider the following code segment.

while (myPainter.canMove()) { myPainter.move(); }

After the loop has terminated, which of the following MUST be true?

The Painter object is blocked from moving north.

The Painter object is blocked from moving east.

The Painter object is blocked from moving west.

The Painter object is blocked from moving south.

4.

MULTIPLE CHOICE QUESTION

30 sec • 5 pts

Which of the following are inherited when one class extends another?

I. private attributes

II. public constructors

III. public methods

A.   I only

B.   III only

C.   I and II

D.   II and III

E.   I, II, and III

A

B

C

D

E

5.

MULTIPLE CHOICE QUESTION

30 sec • 5 pts

Consider the following code segment.

if (myPainter.isFacingNorth()) {

myPainter.move();

myPainter.move(); }

if (!myPainter.isFacingNorth()) {

myPainter.move();

myPainter.paint("green"); }

Which of the following is equivalent?

Media Image
Media Image
Media Image
Media Image

6.

MULTIPLE CHOICE QUESTION

30 sec • 5 pts

Media Image

Given a Painter object called myPainter, which method call would cause a syntax error?

myPainter.move();

myPainter.turnLeft();

myPainter.takePaint();

myPainter.canMove();

myPainter.paint();

7.

MULTIPLE CHOICE QUESTION

30 sec • 5 pts

Which of the following correctly instantiates a new Painter object?

Painter daVinci = new Painter();

daVinci Painter = new Painter();

Painter daVinci = Painter();

Painter() daVinci = new Painter;

Painter daVinci = Painter;

Create a free account and access millions of resources

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?