Friday, November 7, 2014

Java Interview Questions

1. What are the features of OOPS?

The five important features of Oops are as fallows.

• Classes and objects

• Abstraction

• Polymorphism

• Inheritance

• Encapsulation

2. What is Abstraction?

Abstraction is a mechanism of hiding the unnecessary features from developers.

3. What is Encapsulation?

Encapsulation is a technique where the properties of a class are bind with methods.

4. What is the difference between abstraction and encapsulation?

• Abstraction focuses on the outside view of an object (i.e. the

interface) Encapsulation (information hiding) prevents clients from seeing it’s inside

view, where the behavior of the abstraction is implemented.

• Abstraction solves the problem in the design side while Encapsulation is the

Implementation.

• Encapsulation is the deliverables of Abstraction. Encapsulation barely talks about

grouping up your abstraction to suit the developer needs.

5. What is Inheritance?

• Inheritance is the process of acquiring the properties of one class into another class.

• A class that is inherited is called base class.

• The class that does the inheriting is called derived class.

• Inheritance is done by using the keyword extends.

• The two most common uses of inheritance are:

o To reuse the code

o To achieve polymorphism

No comments:

Post a Comment