Java Objects Basics Quiz

Java Objects Basics Quiz

University

20 Qs

quiz-placeholder

Similar activities

C - Structures

C - Structures

University

20 Qs

ARRAYS AND FUNCTIONS

ARRAYS AND FUNCTIONS

University

15 Qs

Java Básico

Java Básico

University

20 Qs

C++ Quiz

C++ Quiz

University

20 Qs

Playing with C

Playing with C

University

20 Qs

Quiz Pemrograman Lanjut 2022/2023

Quiz Pemrograman Lanjut 2022/2023

University

20 Qs

Recap

Recap

University

15 Qs

oops using java quiz

oops using java quiz

University

15 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?