Java Quiz: Class, Object, and Final

Java Quiz: Class, Object, and Final

1st Grade

8 Qs

quiz-placeholder

Similar activities

INTRODUCTION TO OOP

INTRODUCTION TO OOP

1st - 3rd Grade

10 Qs

Pemrograman berorientasi objek

Pemrograman berorientasi objek

1st - 10th Grade

13 Qs

Quiz 9 (15.09.2021)

Quiz 9 (15.09.2021)

1st - 12th Grade

10 Qs

Website Design

Website Design

KG - University

10 Qs

ECA quiz exam

ECA quiz exam

1st - 5th Grade

10 Qs

JAVA-STRINGS-VLITS

JAVA-STRINGS-VLITS

1st Grade

13 Qs

LMS Quiz

LMS Quiz

1st - 3rd Grade

5 Qs

่java-1

่java-1

1st Grade

10 Qs

Java Quiz: Class, Object, and Final

Java Quiz: Class, Object, and Final

Assessment

Quiz

Computers

1st Grade

Hard

Created by

Farjana Jui

Used 1+ times

FREE Resource

8 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is a class in Java?

A blueprint for creating objects

A method for organizing code

A keyword used for loops

A type of data structure

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

How do you create an object in Java?

makeObject(ClassName)

createObject(Class)

ClassName.create()

new ClassName()

3.

MULTIPLE CHOICE QUESTION

1 min • 2 pts

Media Image

What is the output of this code?

Null

compiler error

Hi!

My Name is: null

4.

MULTIPLE CHOICE QUESTION

1 min • 2 pts

Media Image

What is the output of this code?

Null

compiler error

a

person

5.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

Explain the significance of the 'final' keyword in Java with an example.

The 'final' keyword in Java is used to allow the variable to be changed multiple times

The 'final' keyword in Java is used to restrict the user. The variable declared as final cannot be changed after it is initialized. It can be used with classes, methods, and variables.

The 'final' keyword in Java is used to make a variable mutable

The 'final' keyword in Java is used to indicate that a variable is not initialized

6.

MULTIPLE CHOICE QUESTION

45 sec • 1 pt

Differentiate between class attributes and methods in Java with examples.

Class attributes are variables, while methods are functions.

Class attributes are static, while methods are dynamic.

Class attributes are constants, while methods are variables.

Class attributes are public, while methods are private.

7.

MULTIPLE CHOICE QUESTION

45 sec • 1 pt

What is object instantiation in Java?

Creating a new variable in Java

Defining a new method within a class

Creating an instance of a class using the 'new' keyword

Importing a new package in Java

8.

MULTIPLE CHOICE QUESTION

45 sec • 1 pt

Provide an example of object instantiation in Java.

createObject(ClassName)

new ClassName()

instantiateObject(ClassName)

ClassName.createInstance()