Professional Documents
Culture Documents
in
“Jh x.ks'kk; ue%“
Q. What is a class ?
Q. What is a on object ?
Q. What is inheritance ?
Ans. the concept where the characterstics of a class are reused in an another class is called
inheritance.
Q. What is a constructor?
Ans. a function having the same name as of the class is called a constructor. it is invoked
automatically while creating object of the class
Ans. a class having multiple functions with same name but different signatures is called method
overloading. it is also called as function overloading.
Ans. the concept in which multiple classes have functions with the same name and same
signatures is called method overriding.
Q. What is a method?
Ans. both are access modifiers - public means accessible anywhere in the program and private
means accessible only within the block in which it is declared.
e. hybrid inheritance
c. hierarchical inheritance
Ans. no java does not support multiple inheritance. we have to use interfaces for this purpose.
Ans. a sub class is synonym of child class which inherits an another super class.
Ans. a class whose object can't be created is abstract class. it only provides framework to other
classes.
a method which does not have its body is abstract method. it is necessary to override an
abstract method.
Q. What is abstraction
Ans. it is also called as data hiding. it is an importnat object oriented feature that hides the
complex implementation details of an object
Q. What is encapsulation?
Ans. Encapsulation is defined as wrapping up of data and information under a single unit.
Q. What is polymorphism?