The following table summarizes the differences between method overriding and method overloading:
| Method Overriding | Method Overloading |
|---|---|
| Arguments of overloaded 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. |
- Become CIW Master CIW Enterprise Developer certified.
- Download free practice test for SUN SCBCD exam.
- Become SUN SCDJWS certified.
- Become SUN SCJP certified.
- Click here to get free scjp-5-0 SCJP 5/6 exam practice questions.
- Download free practice test for SUN SCMAD exam.
- Become SUN SCWCD certified.
- Become SUN Java 5.0 certified.
- Click here to get free CX310-065 SCJP 6.0 exam practice questions.
Like this article? Share it with others
If you like this article, please leave a comment or subscribe this blog via RSS or via e-mail, Bookmark and share through your network. Click the AddThis button below. Thanks.
If you like this article, please leave a comment or subscribe this blog via RSS or via e-mail, Bookmark and share through your network. Click the AddThis button below. Thanks.