Monday, 12 September 2011

Difference between Overloading and Overriding? java interview questions...


Ans
          
               1. In overloading,there is a relation ship between methods 
                   available in the same class where as in overridding,there 
                   is relationship between a super class method and subclass 
                   method.
               2. overloading doesn't block  inheritence from the 
                   superclass where as overridding blocks inheritence.

              3. in overloading,seperate methods share the same name 
                  where as in overridding,subclass methods replaces the 
                 superclass.

              4.overloading must have different method signatures where 
                 as overriding must have same signature.

                                 more answers click here

No comments: