Summary of
OOP course on 18th october 2012
·
Reusesability
Reusesability is the ability to
reuse
·
Inheritance
A class that is derived from another class is called a subclass (also a
derived class, extended class, or child class). The class from which the
subclass is derived is called a superclass (also a base class or a parent
class).
·
Abstraction
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.
·
Polimorphsm
The ability of an object to take on many forms. In programming languages polymorphism is the capability of an action or method to do different things based on the object that it is acting upon. This is the third basic principle of object oriented programming. The three types of polymorphism are: ad-hoc (overloading and overriding), parametric (generics) and dynamic method binding.
·
Method
Overloading
a function means that you have multiple functions with the same name, but different signatures. The signature of a function is its return type and number/types of parameters.
·
Method
Overriding
a method in the child
class having the same name, same number of parameters and the same access
specifier as in it’s parent then we can say that we are doing method
overriding.
The example of
Polimorphsm:
Bird myBird = null;
myBird = new Bird (7);
myBird.beak();
System.out.println ("");
myBird.beak();
System.out.println ("");
{
super ();
this.flyVelocity = v;
System.out.println("This Bird flyVelocity is " +flyVelocity);
}
super ();
this.flyVelocity = v;
System.out.println("This Bird flyVelocity is " +flyVelocity);
}
0 komentar:
Posting Komentar