View RSS Feed

Polymorphism

Java Polymorphism

  1. Abstract Methods

    by , 04-26-2012 at 06:01 PM
    If you desire a particular method to be present in a class and actual methodís implementation be determined by the help of a child class then you must be declaring methods which are present in parent class, as an abstract.
    A method to be declard as an abstract, abstract keyword is being used. There is no method body in abstract method but do have a method signature.
    Signatures of abstract methods are followed by semicolon and they have no definition:
    Java Code:
    public abstract
    ...
    Categories
    Polymorphism
  2. Java - Abstraction

    by , 04-26-2012 at 06:00 PM
    Abstraction means an ability to create the class abstract, in OOP. Basically, an abstract class is not able to get instantiated. All remaining class functionalities are still present and its methods, fields & constructors are accessible in similar way. Just abstract classís instance canít be created.

    If it is not possible to instantiate a class and it is abstract then such kind of class has no particular uses, until it gets subclasses. Typically, in this way abstract class will ...
    Categories
    Polymorphism
  3. Polymorphism

    by , 04-26-2012 at 05:57 PM
    Polymorphism is considered as an objectís ability so that it could take on various forms. It is most commonly used in OOP where parent class reference usually refers the child class objects.

    Any java object that can pass more than one IS-A test is considered to be polymorphic. In Java, all java objects are polymorphic since any object will pass the IS-A test for their own type and for the class Object.
    It shall be known that objects are access by one single way and that is ...
    Tags: polymorphism Add / Edit Tags
    Categories
    Polymorphism