0% found this document useful (0 votes)
17 views6 pages

Gmail - Java Quiz2!24!25_D1AD

Uploaded by

chetnanawlani91
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
17 views6 pages

Gmail - Java Quiz2!24!25_D1AD

Uploaded by

chetnanawlani91
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 6

Java Quiz2_24-25_D1AD

1 message

Google Forms <forms-receipts-noreply@google.com> Fri, 22 Nov, 2024 at 1:14 pm


To: 2024.chetna.nawlani@ves.ac.in

Thanks for filling out Java Quiz2_24-25_D1AD


Here's what was received.

View score

Java Quiz2_24-25_D1AD
Your email (2024.chetna.nawlani@ves.ac.in) was recorded when you submitted this form.

Basic Details

Student Name *

Chetna Nawlani

Class *

D1ADA

Roll No. *

46
Quiz

What is the main reason Java does not support multiple inheritance using classes?

Memory constraints

Security reasons

Diamond problem

Performance issues

Which rule must be followed for method overriding?

Method name and parameters must differ.

Method signature must match exactly.

Method must be declared as final.

Both methods must be static.

What does the super keyword in Java refer to? *

he current object

The parent class

The child class

A static method
What happens if you declare a method as final? *

It can be overridden by subclasses.

It cannot be inherited by subclasses.

It cannot be overridden by subclasses.

It becomes a static method.

How does Java achieve multiple inheritance? *

By using the extends keyword with multiple classes

By using the implements keyword with interfaces

By using super to reference multiple classes

Java does not support multiple inheritance

What happens if a class has at least one abstract method?

It must be declared as abstract.

It must implement all its methods.

It cannot have a constructor.

It cannot be inherited.

Which of the following is true about the final variable? *

It can be reassigned after initialization.

It cannot be assigned a value at the time of declaration.

It cannot change its value once initialized.


It must be static.

What will be the output of the following Java code?


*

Drawing Circle

Compilation error

Runtime error

Abstract classes cannot be instantiated.

What will happen if you uncomment the display() method in the Derived class? *
It will override the method in the Base class.

Compilation error due to trying to override a final method.

Runtime error due to method conflict.

The program will execute without issues.

What will be the output of the program?

*
Parent constructor Child constructor

Child constructor

Compilation error

Runtime error

Create your own Google Form


Report Abuse

You might also like