Java Objects Basics Quiz

Java Objects Basics Quiz

University

20 Qs

quiz-placeholder

Similar activities

Code-A-Vita

Code-A-Vita

University

20 Qs

Semester Final Part 2

Semester Final Part 2

10th Grade - University

15 Qs

Quiz PBO SIA

Quiz PBO SIA

University

20 Qs

STEAM CAT 3RD TERM

STEAM CAT 3RD TERM

2nd Grade - University

20 Qs

Quantitative Aptitude Series

Quantitative Aptitude Series

University

20 Qs

OOP - Java Classes

OOP - Java Classes

12th Grade - University

15 Qs

Java GUI

Java GUI

University

15 Qs

Java Objects - Real world Scenarios - Practice Quiz

Java Objects - Real world Scenarios - Practice Quiz

University

20 Qs

Java Objects Basics Quiz

Java Objects Basics Quiz

Assessment

Quiz

Computers

University

Hard

Created by

VIKAS BANDARU

Used 11+ times

FREE Resource

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.

Create a free account and access millions of resources

Create resources
Host any resource
Get auto-graded reports
or continue with
Microsoft
Apple
Others
By signing up, you agree to our Terms of Service & Privacy Policy
Already have an account?