Menu mobile
Home
PYTHON
Python Tutorial
Program Example
Interview Questions
JAVA
Java Tutorial
Program Example
Interview Questions
C Language
C Tutorial
Program Example
Interview Questions
Web Design
HTML
CSS
Java Script
PHP
Assignment
MS Office
HTML
CSS
Java Script
QUIZ ON : JAVA - ENCAPSULATION AND INHERITANCE
ENCAPSULATION AND INHERITANCE
00:00:00
English
Hindi
Question No# :
01
out of 10
An OOP feature that allows all members of a class to be the members of another class.
A.
Encapsulation
B.
Abstraction
C.
Inheritance
D.
Polymorphism
Question No# :
02
out of 10
Which feature can be implemented using encapsulation?
A.
Inheritance
B.
Abstraction
C.
Polymorphism
D.
Overloading
Question No# :
03
out of 10
Which access specifier allows accessibility of a member only within the same class where it is declared?
A.
public
B.
private
C.
protected
D.
default
Question No# :
04
out of 10
A static member a is declared in a class named ‘Myclass’, write the statement to initialise it with 5, from a function in another class.
A.
a=5;
B.
a of Myclass=5;
C.
Myclass.a=5;
D.
a.Myclass=5;
Question No# :
05
out of 10
What is the purpose of an abstract class
What is the purpose of an abstract class
A.
To provide help with database connectivity
To provide help with database connectivity
B.
To provide data input to other classes
To provide data input to other classes
C.
To provide security to other classes
To provide security to other classes
D.
To provide an appropriate base class from which other classes can inherit
To provide an appropriate base class from which other classes can inherit
Question No# :
06
out of 10
How can Encapsulation be achieved?
A.
Using Access Specifiers
B.
Using only private members
C.
Using inheritance
D.
Using Abstraction
Question No# :
07
out of 10
Which keyword allows Inheritance?
A.
extend
B.
extends
C.
for
D.
protected
Question No# :
08
out of 10
Inheritance is referred to as
Inheritance is referred to as
A.
"is a" relationship
"is a" relationship
B.
"have a" relationship
"have a" relationship
C.
Both A and B
Both A and B
D.
None of These
None of These
Question No# :
09
out of 10
Which access specifier allows accessibility by all classes in the same package, but only by subclasses in a different package?
A.
public
B.
private
C.
protected
D.
default
Question No# :
10
out of 10
Wrapping up of data and method into a single unit is called___
A.
Encapsulation
B.
Abstraction
C.
Inheritance
D.
Polymorphism
CCC Online Test 2021
CCC Practice Test Hindi
Python Programming Tutorials
Best Computer Training Institute in Prayagraj (Allahabad)
Best Java Training Institute in Prayagraj (Allahabad)
Best Python Training Institute in Prayagraj (Allahabad)
O Level NIELIT Study material and Quiz
Bank SSC Railway TET UPTET Question Bank
career counselling in allahabad
Sarkari Naukari Notification
Best Website and Software Company in Allahabad
Website development Company in Allahabad