Search Header Logo

Java-oops2

Authored by lawrance r

Computers

University

Used 2+ times

Java-oops2
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 keyword is used to define an abstract method in Java?

static

final

abstract

interface

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the return type of an abstract method in Java?

It can be any valid return type

It must always be void

It must always return an int

Abstract methods cannot have a return type

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following is true about method overloading?

Method names must be different

Method return types must be different

Method overloading is not allowed in Java

Method parameters must be different

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following is an example of method overriding?

Two methods with the same name but different parameters in the same class

A subclass redefining a method from its parent class

Two different classes having methods with the same name

A method calling another method

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is required for method overriding to work properly in Java?

The method must have the same name, return type, and parameters in the subclass

The method must have a different name in the subclass

The method must be static

The method must have a different return type

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What happens if a method is marked as final in a class?

It can be overridden

It cannot be overridden

It becomes abstract

It can only be accessed within the same class

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

In method overloading, how is the method call resolved?

At runtime

At compile-time

At both compile-time and runtime

None of the above

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