Programming Interview
Questions and Answers
What are the main features of Java?
✓~ 1. Object-oriented
2. Simple
3. Platform Independent
4. Secured
5. Robust
6. Portable
7. Multithreaded
8. Distributed
What are the fundamental principles of OOP?
✓~ 1. Inheritance
2. Abstraction
3. Polymorphism
4. Encapsulation
What is Inheritance in Java?
, ✓~ Inheritance is one of the key principles of OOP. Through Inheritance, one class can
inherit the properties of another class. The class from which properties are inherited is called
a "super" class and the class to which properties are inherited is called a sub class.
What is Constructor Overloading and its use?
✓~ A class can have any number of constructors. These constructors will have different
lists of arguments. It is called constructor overloading. Constructor overloading provides
different ways to instantiate a class.
What is polymorphism in Java?
✓~ Polymorphism refers to any entity whether it is a method, constructor or an operator
which takes many forms or can be used for multiple tasks.
What is method overloading in Java?
✓~ When a class has more than one method with the same name but with different lists of
arguments.
What is method overriding?
✓~ When a super class method is modified in the sub class then it is called method
overriding.
Does Java support multiple inheritance?