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

Start

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

Start

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

Start

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

Start

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

Start

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

Start

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

Start

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

Start

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

Start

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

Start

["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%

Completed

0/10

Accuracy

0%

Get Prepinsta Prime

Get all 200+ courses offered by Prepinsta

Never Miss an OffCampus Update

Get OffCampus Updates on Social Media from PrepInsta

Follow us on our Media Handles, we post out OffCampus drives on our Instagram, Telegram, Discord, Whatsdapp etc.

Get Hiring Updates
Amazon,Google,Delottie & 30+companies are hiring ! Get hiring Updates right in your inbox from PrepInsta

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.

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.

Get PrepInsta Prime Subscription

Get access to all the courses that PrepInsta offers, check the out below -

Companies

TCS, Cognizant, Delloite, Infosys, Wipro, CoCubes, KPMG, Amazone, ZS Associates, Accenture, Congnizant & other 50+ companies

Programming

Data Structures, Top 500 Codes, C, C++, Java Python & other 10+ subjects

Skills

Full Stack Web Development, Data Science, Machine Learning, AWS Cloud, & other 10+ skills and 20+ projects