Login  |  Register
AbleShare - SEO Friendly Web Directory  - Article Details
STATISTICS
  • Active Links: 195
  • Pending Links: 972
  • Todays Links: 2
  • Total Articles: 12
  • Total Categories: 14
  • Sub Categories: 475

Java - implement or extend?

Date Added: June 02, 2009 02:38:51 PM
Author: AbleShare
Category:
"implements" is for interfaces ; "extends" is for classes.

You implement interfaces and you extend classes. You can only extend one class in java, but you can implement many interfaces.

When you "extend" a class, any methods that you write with the same name will override the parent class' method.

When you "implement" a class, the parent class had nothing more than the method definition (i.e. there was no code in the method) so, in effect, all you are doing is adding your own method code to what was just a method declaration and therefore not overriding the parent methods.
Ratings
You must be logged in to leave a rating.
Average rating: (0 votes)
Comments

No Comments Yet.


You must be logged in to leave a Comment.
ARTICLES
Java - implement or extend?
Whats the difference between "implements" and "extends"?
What Are The Uses For Garage Conversions?
With the current housing market and economic climate as it is at the moment, it has seen a rise in people deciding on alternative methods of increasing space in their home instead of moving.
Copy text to Clipboard on One Click
Solution to Flash Player 10's copy on click problem
Five Ways For Moving Out Of State
Choose the best moving company for relocation
How we picked the Best Places to Live
Find livable locales that combine the best of city and suburban life