Friday, June 25, 2010

Encapsulation in Java

Encapsulation - refers to the hiding of data and methods within an objects. and also protects data from corruption.
                       - easier to modify programs since one object type is modified at a time.

Abstraction in java

Abstraction refers to the ability to make a class abstract in OOP.

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.