InfyTQ Abstarct, final and Interfaces Quiz 1

Question 1

Time: 00:00:00
What do you mean by abstraction in Java?

The capability of a class in java to derive the characteristics or properties from another class is known as abstraction.

The capability of a class in java to derive the characteristics or properties from another class is known as abstraction.

Abstraction can be defined as the ability through which only the required details are displayed to the user, the non-essential details are not shown to the user.

Abstraction can be defined as the ability through which only the required details are displayed to the user, the non-essential details are not shown to the user.

Abstraction can be defined as the combining of code and data in a single unit.

Abstraction can be defined as the combining of code and data in a single unit.

none of the above

none of the above

Once you attempt the question then PrepInsta explanation will be displayed.

Please login to submit your explanation

Question 2

Time: 00:00:00
Which of the following features allow the functionality of multiple inheritance in JAVA ?

Abstract class

Abstract class

Interface

Interface

Polymorphism

Polymorphism

Encapsulation

Encapsulation

Once you attempt the question then PrepInsta explanation will be displayed.

Please login to submit your explanation

Question 3

Time: 00:00:00
Consider the following two statements:

  1. The final keyword restricts the user to perform any kind of changes in the component with which it is associated.

  2. The final keyword is applicable only to variables , methods and classes.


Which of the following statements are true?

Statement 1

Statement 1

Statement 2

Statement 2

Both 1 and 2 are true

Both 1 and 2 are true

Both 1 and 2 are false

Both 1 and 2 are false

Once you attempt the question then PrepInsta explanation will be displayed.

Please login to submit your explanation

Question 4

Time: 00:00:00
The final keyword can be used with which of the following components in Java?

Variable

Variable

Method

Method

Classes

Classes

All of the above

All of the above

Once you attempt the question then PrepInsta explanation will be displayed.

Please login to submit your explanation

Question 5

Time: 00:00:00
What is the difference between const and final keywords?

Both const and final keywords are used in java.

Both const and final keywords are used in java.

Only const keyword is allowed in java

Only const keyword is allowed in java

Only final keyword is allowed in java

Only final keyword is allowed in java

none of the above

none of the above

Once you attempt the question then PrepInsta explanation will be displayed.

Please login to submit your explanation

Question 6

Time: 00:00:00
Java does not allow the user to create instances of?

Interfaces

Interfaces

Abstract Classes

Abstract Classes

Nested Classes

Nested Classes

Both A and B

Both A and B

Once you attempt the question then PrepInsta explanation will be displayed.

Please login to submit your explanation

Question 7

Time: 00:00:00
How do you declare an abstract class?

An abstract class is declared using the abstract keyword

An abstract class is declared using the abstract keyword

An abstract class is declared using the final keyword

An abstract class is declared using the final keyword

An abstract class is declared using the virtual keyword

An abstract class is declared using the virtual keyword

An abstract class is declared using the static keyword

An abstract class is declared using the static keyword

Once you attempt the question then PrepInsta explanation will be displayed.

Please login to submit your explanation

Question 8

Time: 00:00:00
What is the default access modifier for an interface?

public

public

private

private

protected

protected

none of the above

none of the above

Once you attempt the question then PrepInsta explanation will be displayed.

Please login to submit your explanation

Question 9

Time: 00:00:00
What is the correct way of implementing an interface “animal” by the class “test” ?

class test extends animal {}

class test extends animal {}

class test defines animal {}

class test defines animal {}

class test implements animal {}

class test implements animal {}

Class test exports animal {}

Class test exports animal {}

Once you attempt the question then PrepInsta explanation will be displayed.

Please login to submit your explanation

Question 10

Time: 00:00:00
A class serves as base class for many derived classes it is called?

polymorphism

polymorphism

multipath inheritance

multipath inheritance

hierarchical inheritance

hierarchical inheritance

none of these

none of these

Once you attempt the question then PrepInsta explanation will be displayed.

Please login to submit your explanation

["0","40","60","80","100"]
["Need more practice!","Keep trying!","Not bad!","Good work!","Perfect!"]

Personalized Analytics only Availble for Logged in users

Analytics below shows your performance in various Mocks on PrepInsta

Your average Analytics for this Quiz

Rank

-

Percentile

0%

Get over 200+ Courses under One Subscription

mute

Don’t settle Learn from the Best with PrepInsta Prime Subscription

Learn from Top 1%

One Subscription, For Everything

The new cool way of learning and upskilling -

Limitless Learning

One Subscription access everything

Job Assistance

Get Access to PrepInsta Prime

Top Faculty

from FAANG/IITs/TOP MNC's

Get over 200+ course One Subscription

Courses like AI/ML, Cloud Computing, Ethical Hacking, C, C++, Java, Python, DSA (All Languages), Competitive Coding (All Languages), TCS, Infosys, Wipro, Amazon, DBMS, SQL and others.