Example & Tutorial understanding programming in easy ways.

7. What is an abstraction?

Abstraction is a good feature of OOPS , and it shows only the necessary details to the client of an object. Means, it shows only necessary details for an object, not the inner details of an object.

                                    OR

 Abstraction is way of converting real world objects in terms of class. For example creating a class Vehicle and injecting properties into it. 

Example:

 

public class Vehicle

{

public String colour;

public String model;

}

 


Example: When you want to switch On television, it not necessary to show all the functions of TV. Whatever is required to switch on TV will be showed by using abstract class.

Read More →