Sudhi,
Thank you for your *clear* example (and thanks to the others who replied as well). Let's see if I get it right.
When you extend a class, you add properties and methods to an existing set of properties and methods
When you implement an interface, you get access to the methods defined in the interface.
Is that basically it? BARKING presumable contains methods that describe how to bark (verbs).
Can you or someone please give an equally clear and concise explanation of the following terms in a java context:
1) interface
2) serializable
There was very skimpy explanation of the examples in this lab, and I didn't understand the interface defined in MyEventsListenerInterface. What was the point of it? And why does a javabean have to be "serializable"?
Great class! I'm getting a lot out of it.
Tanya
-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of sudhi
Sent: Thursday, February 19, 2009 11:48 PM
To: Free Java Programming Online Training Course By Sang Shin
Subject: [java programming] Re: "extends" vs. "implements" LAB-1021
Dear Tanya
To be very simple its just like
public class ANIMALS
{
Has features like head, body as instance variables }
public class DOG extends ANIMALS
{
has features of ANIMALS with some more features
added to it like curved tail.
}
and it can be
public class CAT extends ANIMALS implements Barking { }
hope this is very very simple to understand
Regards
Sudhi
--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [email protected]
For more options, visit this group at http://groups.google.com/group/javaprogrammingwithpassion?hl=en
-~----------~----~----~----~------~----~------~--~---
- [java programming] Re: "extends" vs. "... Tanya Dina Ruttenberg
- [java programming] Re: "extends" vs. ... Arkumik Raneas
- [java programming] Re: "extends" ... Rajiv Narula
