Tuesday, July 6, 2010

What is OOPS ?

OOPS: Object Oriented Programming System or Structure, it is  an way of coding which closely resembles the property of evolution in nature.



It constitutes of Class and Objects also called Instances, and it implements three properties, Polymorphism, Encapsulation and Inheritence using the four access controls in ActionScript 3.0, which are:
  1. Public: Open to All.
  2. Private: Reserved for the Class.
  3. Protected: The Class and Subclass or Childclass can use it.
  4. Internal: All the classes in the package can access it.
There is one fifth control too called Final. It is used when we don't want that somebody can extend our class.


Let us consider the example of tyre. It extends the Class Rubber hence Inheritence, how the tyre is made from rubber we don't know hence Encapsulation, now we can create tyre of different types like cycle or car tyre etc which is only possible through polymorphism.

No comments:

Post a Comment

Suggestions are heartily awaited.