Search Header Logo

Java Test2

Authored by Prof. Harish T. Gwalani

Computers

University

Used 2+ times

Java Test2
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

50 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the default value of an object reference in Java?

0
null
undefined
empty

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which keyword is used to create an object in Java?

create
class
new
object

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What does a constructor do in Java?

Destroys an object
Allocates memory
Initializes an object
Calls methods

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which keyword is used to define a class in Java?

define
struct
class
object

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the return type of a constructor?

void
int
class type
None

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which method is called automatically when an object is created?

init()
constructor
main()
finalize()

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

How many constructors can a class have?

Only one
Two
Unlimited
None

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?