SCJP Certification

Sun Certified Java Programmer Certification exam essentials

August 19th, 2010

What are the differences between method overriding and method overloading?

Sun Java Certifications, by Daisy Williams.

The following table summarizes the differences between method overriding and method overloading:

Method OverridingMethod Overloading
Arguments of overridden methods cannot be changed.Arguments of overloaded methods can be changed.
Method return types cannot be changed except covariant return types. Return types can be changed.
Exceptions must not throw new or broader checked exceptions.Exceptions can be changed.
It happens at runtime.It happens at compile-time.
An object type determines which method is selected.A reference type determines which method is selected.

Share

Back Top

Responses to “What are the differences between method overriding and method overloading?”

Comments (0) Trackbacks (0) Leave a comment Trackback url
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Your email address will not be published. Required fields are marked *

*