Java-oops2

Java-oops2

University

10 Qs

quiz-placeholder

Similar activities

Java Methods & Constructors

Java Methods & Constructors

University

10 Qs

MPP Quiz I

MPP Quiz I

University

10 Qs

IB CS Programming

IB CS Programming

7th Grade - University

12 Qs

P1_APLab2Quiz_B3B4

P1_APLab2Quiz_B3B4

University

10 Qs

Quiz #2 (Refer to Javatpoint in answering these question)

Quiz #2 (Refer to Javatpoint in answering these question)

University

13 Qs

javaquizvivek

javaquizvivek

University

12 Qs

W10: Abstract Classes

W10: Abstract Classes

University

5 Qs

Java-oops2

Java-oops2

Assessment

Quiz

Computers

University

Hard

Created by

lawrance r

Used 2+ times

FREE Resource

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

Create a free account and access millions of resources

Create resources
Host any resource
Get auto-graded reports
or continue with
Microsoft
Apple
Others
By signing up, you agree to our Terms of Service & Privacy Policy
Already have an account?