OPP Revision Unit I & II

OPP Revision Unit I & II

University

35 Qs

quiz-placeholder

Similar activities

AzhBaz-hdebdebdeby Malimemi bazas RK1 (1-35)

AzhBaz-hdebdebdeby Malimemi bazas RK1 (1-35)

University

35 Qs

Quiz on Lesson 1 CSU3200

Quiz on Lesson 1 CSU3200

University

33 Qs

BICS 1302 Chapter 1 - Introduction to Computer Organization:

BICS 1302 Chapter 1 - Introduction to Computer Organization:

University

30 Qs

Introduction to Structured Query Language (SQL)

Introduction to Structured Query Language (SQL)

University

30 Qs

Икт рк1

Икт рк1

University

40 Qs

ข้อสอบปลายภาคบทที่ 1-9

ข้อสอบปลายภาคบทที่ 1-9

University

40 Qs

Java Programming Quiz

Java Programming Quiz

University

40 Qs

HO2_Info_MGT

HO2_Info_MGT

University

30 Qs

OPP Revision Unit I & II

OPP Revision Unit I & II

Assessment

Quiz

Information Technology (IT)

University

Medium

Created by

Vidhi Pitroda

Used 1+ times

FREE Resource

35 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the main purpose of an abstract class in Java?

To provide a complete implementation

To provide partial implementation

To define a contract for subclasses

To allow instantiation of objects

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which keyword is used to declare an abstract method?

abstract

final

static

void

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the output of the following code? class A { void display() { System.out.println("Hello"); } } A a = new A(); a.display();

Hello

Error

Hello World

Nothing

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following is true about interfaces in Java?

Interfaces can be instantiated

Interfaces can have constructors

Interfaces can contain instance fields

Interfaces can extend multiple other interfaces

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the purpose of the 'super' keyword in Java?

To define a new class

To access private members of a class

To call a method from the parent class

To create a new instance of a class

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What will happen if a subclass does not implement all abstract methods of its superclass?

The superclass will be ignored

The subclass will compile successfully

The subclass must also be declared abstract

The program will run with errors

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following statements about packages is true?

Packages are not necessary in Java

Packages cannot be nested

Packages help avoid naming conflicts

Packages can only contain classes

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?