ContactUs :

Please send your Questions & Answers or Feedback to "mohan@javabook.org"

Why Object ?

Object class is the super class for all the classes in java. If we don't know the type of the object which we are passing to a method at runtime then declare the method argument type as Object and if we don’t know the type of the object which we are returning then declare the return type as Object. If the argument type is object, it means we can pass any object, if the return type is object then it can return any object.
        We never create an object for Object class and we never return Object class object.
        We can give super class reference to sub class, but we cannot give super class object to the subclass.
        If we are calling a method then the method must be there in the corresponding reference type.
Related Posts Plugin for WordPress, Blogger...
Flag Counter