Java

22
2553 reads

February 19, 2013

Run Time Polymorphism


Polymorphism allows you define one interface and have multiple implementation. This example demonstrates polymorphism.

27
2521 reads

February 19, 2013

Method Overriding: Super()


In case of method overriding, the method in super class is hidden by the sub-class method. This example demonstrates how to use super() to call the super classes method.

30
2458 reads

February 19, 2013

Method Overriding


This example demonstrates method overriding.

33
2482 reads

February 19, 2013

Order of calling of constructors


This example demonstrates when constructors are called.

40
2517 reads

February 19, 2013

Clone of object


Cloning an object means, creating a copy of object. This example demonstrates constructing clone of an object.

23
2458 reads

February 19, 2013

Complete Implementation of BoxWeight


This example demonstrates a complete implementation of a derived class.

37
2794 reads

February 19, 2013

super keyword


This example depicts the use of super keyword.

28
2596 reads

February 19, 2013

Assigning reference variable.


In this, objects 'weightbox' and 'plainbox' are created from the classes BoxWeight and Box respectively.

38
2700 reads

February 19, 2013

Extend box class to include color


In this example, the class Box is extended by class ColorBox in order to add color variable for each box.

40
2651 reads

February 19, 2013

Inheriting a class


This program uses inheritance to extend the class Box.