Thursday, November 28, 2013

What is Encapsulation?

Encapsulation means that a group of related properties, methods, and other members treated as a single unit or object. This hides the data from being accessed from outside a class directly, only through the functions inside the class is able to access the information.

What is difference between class and object?

Class is a blue print or some template and object is a building created from this blue print or template. Class is a more abstract definition of something and object is the real thing that belongs to that class.
For example
Class:

class Bike {
       
    }

Object:


Bike myObject = new Bike();