Here are some of the important questions that can be asked by the interviewer related to the programming job positions. These questions are related to various sub-topics and can help you in preparing for your interview.
- Name the four principles of OOPS.
Abstraction, Polymorphism, Inheritance and Encapsulation are the four basic principles of OOPS.
- How do you define Encapsulation?
The process used in hiding the behaviors and properties of the object, providing access to it from outside only when necessary. This process keeps the other objects away from altering the characteristics of the object, which has been encapsulated.
- Define Inheritance and give some explanation.
In this process, the objects belonging to one class attain the properties of the objects in the other class.
- Superclass is the class, which is inherited.
- A subclass is a class that has acquired the inherited properties.
- The process of inheritance is completed by using the extended keywords
- Reusing the code and utilization of polymorphism are the two reasons of polymorphism.
- How do you define super?
The techniques or the member variables are accessed through the keyword known as super. It can be useful in both cases i.e. if the method is hidden or overridden.
- Define interface.
An interface is defined as the description of a group of techniques, which must be possessed by conforming classes. The variable of the interface should be static. However, an interface cannot be used as final and it is only used for extension of interfaces.
- Can the interface be instantiated?
The interfaces cannot be instantiated but the classes used for implementing the interface can be instantiated.
- Is it necessary to develop an item for the interface?
As interfaces cannot be instantiated on their own and you have to write a class for implementing the interface this is why it is necessary to create an item or object for the execution of the interface.
Need more core java interview questions? then you must visit this website “Jave Programs Hub Website” to know more questions and its answers.