View RSS Feed

Java Object

Object-oriented programming in Java.

  1. Casting Objects

    by , 04-26-2012 at 06:36 PM
    As it has been shown that object is class’s data type, from which instantiation took place. If we write, for example:
    Java Code:
    public MountainBike myBike = new MountainBike();
    myBike is of type, MountainBike.

    MountainBike get descended from Object & Bicycle. Hence, MountainBike is an object as well as a Bicycle. It is used when Object or Bicycle objects are called.

    It is not necessary that reverse is true: Bicycle might be MountainBike, however ...