Search Header Logo

Java Unit2 MCQ Test

Authored by Prof. Harish T. Gwalani

Computers

University

Used 2+ times

Java Unit2 MCQ Test
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

30 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is used to create an object in Java?

new
class
method
object

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the default return type of a constructor?

int
void
class type
no return type

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What keyword is used to refer to the current object in Java?

super
self
this
current

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of these is not a type of method overloading?

Same method name
Different return type
Different parameter type
Same parameter order

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following is a correct declaration of an integer array?

int arr() = new int[5];
int arr[] = new int[5];
arr = int[5];
array int arr[5];

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What does a constructor do?

Initializes object
Deletes object
Prints object
Copies object

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

How can you differentiate constructors?

Return type
Parameter list
Method name
Access specifier

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?

Discover more resources for Computers