OOPs Quiz - Advanced

OOPs Quiz - Advanced

University

25 Qs

quiz-placeholder

Similar activities

Endocrine Exam 3- Madras

Endocrine Exam 3- Madras

University

21 Qs

Tech quiz-july

Tech quiz-july

University

20 Qs

First Sessional: Communication Skills

First Sessional: Communication Skills

University

20 Qs

Starbucks Knowledge Quiz

Starbucks Knowledge Quiz

University - Professional Development

20 Qs

Assessment 2 Quiz

Assessment 2 Quiz

University

20 Qs

bread and dough

bread and dough

10th Grade - University

20 Qs

BCS - Resistance Quiz

BCS - Resistance Quiz

University

20 Qs

Kerajian Pasar Lokal

Kerajian Pasar Lokal

12th Grade - University

20 Qs

OOPs Quiz - Advanced

OOPs Quiz - Advanced

Assessment

Quiz

Other

University

Practice Problem

Easy

Created by

Crackify Crackify

Used 2+ times

FREE Resource

AI

Enhance your content in a minute

Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...

25 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

What is the output of the following code? class Test { int x; Test(int x) { this.x = x; } void print() { System.out.println(x); } } Test t = new Test(5); t.print();

5

0

Error

null

2.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

Which keyword is used to call a superclass constructor?

this

super

extends

base

3.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

What is the output of the following code? class A { A() { System.out.println("A's Constructor"); } } class B extends A { B() { System.out.println("B's Constructor"); } } new B();

B's Constructor

A's Constructor

A's Constructor B's Constructor

Error

4.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

Which of the following can be overloaded?

Constructors

Static methods

Main method

All of the above

5.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

What is the role of a constructor in Java?

Initialize objects

Destroy objects

Create classes

Run threads

6.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

Which of these is NOT true about abstract classes?

Can have abstract and non-abstract methods

Can be instantiated

Can have constructors

Can have static methods

7.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

Which keyword is used to prevent inheritance?

private

static

final

const

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?