Java Objects Quiz

Java Objects Quiz

12th Grade

8 Qs

quiz-placeholder

Similar activities

Lesson 6 Assessment Quiz

Lesson 6 Assessment Quiz

java quiz on Inheritance

java quiz on Inheritance

B3-8.1 Polymorphism - Encapsulation

B3-8.1 Polymorphism - Encapsulation

B3-8.2

B3-8.2

Java Objects Quiz

Java Objects Quiz

Assessment

Quiz

Computers

12th Grade

Hard

Created by

Andrea Cascia

FREE Resource

AI

Enhance your content in a minute

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

8 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following is true about classes in Java?

A. A class is a blueprint for an object

B. A class can have multiple instances

C. A class can inherit properties and methods from another class

D. All of the above

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is encapsulation in Java?

A. It is a mechanism to restrict access to class members

B. It is a way to create multiple instances of a class

C. It is a technique to achieve polymorphism

D. It is a process of hiding data within a class

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following is an example of polymorphism in Java?

A. Method overloading

B. Method overriding

C. Both A and B

D. None of the above

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is abstraction in Java?

A. It is a way to create multiple instances of a class

B. It is a technique to achieve polymorphism

C. It is a process of hiding data within a class

D. It is a mechanism to represent essential features without including the background details

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which keyword is used to create an object in Java?

A. new

B. create

C. object

D. instance

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the purpose of a constructor in Java?

A. To create multiple instances of a class

B. To initialize the object's state

C. To achieve polymorphism

D. To hide data within a class

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following is NOT a valid access modifier in Java?

A. public

B. private

C. protected

D. global

8.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the output of the following code? public class MyClass { public static void main(String[] args) { MyClass obj = new MyClass(); System.out.println(obj); } }

A. MyClass@

B. MyClass

C. obj

D. null