Search Header Logo

Java Objects Basics Quiz

Authored by VIKAS BANDARU

Computers

University

Used 11+ times

Java Objects Basics Quiz
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

20 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

20 sec • 1 pt

In Objects-First learning, what is the blueprint that defines state and behaviour for objects?

Object
Class
Field
Method
Package

Answer explanation

A class defines the fields (state) and methods (behaviour); objects are instances.

2.

MULTIPLE SELECT QUESTION

30 sec • 1 pt

In Circle, which of the following are part of the state?

diameter
xPosition
isVisible
draw()
moveRight()

Answer explanation

State is stored in fields; draw()/moveRight() are behaviours (methods).

3.

MULTIPLE CHOICE QUESTION

20 sec • 1 pt

Guess the concept name: “A block of code defined in a class that can make an object act and may change its fields.”

Field
Constructor
Behaviour (method)
Package
Type

Answer explanation

Behaviours are methods; they can change the object’s state.

4.

MULTIPLE CHOICE QUESTION

20 sec • 1 pt

Immediately after Circle c = new Circle(); (no other calls), what is c.color?

"red"
"blue"
"green"
null
"black"

Answer explanation

The default constructor sets color = "blue".

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

After Square s = new Square(); s.moveLeft(); s.moveUp();, what are (xPosition, yPosition)?

(330, 140)
(310, 120)
(290, 100)
(290, 120)
(310, 100)

Answer explanation

Start (310,120). Left → x=290; Up → y=100.

6.

MULTIPLE SELECT QUESTION

30 sec • 1 pt

Which actions directly change state without needing extra information?

moveRight()
moveHorizontal(int distance)
makeVisible()
changeColor(String)
moveDown()

Answer explanation

moveRight()/moveDown() have fixed deltas; makeVisible() flips isVisible. Others need parameters.

7.

MULTIPLE CHOICE QUESTION

20 sec • 1 pt

Guess the meaning: In this chapter’s context, “state change” primarily means…

Modifying method signatures
Changing the values of the object’s fields
Creating a new instance
Compiling the project
Importing a package

Answer explanation

State is represented by field values; changing them changes the state.

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?

Discover more resources for Computers