View RSS Feed

Recent Blogs Posts

  1. Returning a Class or Interface

    by , 04-26-2012 at 04:39 PM
    When a class name is used by a method as its return type, like whosFastest would be doing, type’s class of returned objects shall be subclass or exact class of return type. Let’s say that class hierarchy is there where java.lang.Number has a subclass ImaginaryNumber that is also the Object’s subclass that has been illustrated in figure given below:

    Name:  1.jpg
Views: 162
Size:  3.1 KB

    ImaginaryNumber’s class hierarchy

    Let’s say a method has been declared so that ...
    Categories
    Tutorial