Thursday, 11 December 2014

Core Java Concepts

Encapsulation in java is a process of wrapping code and data together into a single unit, for example capsule i.e. mixed of several medicine. User doesn't want to know how it is actually implemented.

Encapsulation is the technique of making the fields in a class private and providing access to the fields via public methods. If a field is declared private, it cannot be accessed by anyone outside the class, thereby hiding the fields within the class. For this reason, encapsulation is also referred to as data hiding

 Abtraction

How you represent the data.

Abstraction is process of hiding the implementation details and showing only the functionality.

An abstract class is one that cannot be instantiated. All other functionality of the class still exists, and its fields, methods, and constructors are all accessed in the same manner. You just cannot create an instance of the abstract class. If a class is abstract and cannot be instantiated, the class does not have much use unless it is subclass. 


No comments:

Post a Comment