Search Header Logo

Java Quiz 2

Authored by Navina Robinson

Computers

University

Used 3+ times

Java Quiz 2
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

10 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is passed when an object is passed to a method in Java?

A new copy of the object                             

A reference to the original object

A copy of the object reference                      

The actual object itself

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is required for a recursive method to terminate correctly?

A loop           

A base case              

A class constructor                 

A static keyword

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What does the static keyword in Java indicate?

method or variable belongs to an instance of the class           

method or variable belongs to the class itself                           

method cannot return a value

variable is final and cannot change

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

How can you pass command-line arguments to a Java program?

Through a file                                                              

Through the main() method's parameters                    

Through the keyboard

Through the constructor

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following is true about inheritance in Java?

Java supports multiple inheritance through classes        

Java supports multiple inheritance using interfaces        

A class can inherit from multiple classes

Java does not support inheritance

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following is not true about the super keyword?

It can be used to access superclass fields                        

It can be used to call superclass constructors                 

It can be used to call superclass methods

It can be used to override static methods

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Why is dynamic method dispatch useful?

For compile-time polymorphism                          

For achieving run-time polymorphism                 

For calling private methods

For method overloading

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?