1>If a class contains a reference variable of another class then the
relataion between those two class is known as has-a relationship
example(1)
class A{
String s;
}
example(2)
class A{
}
class C{
A a;
}
READ THIS AS CLASS C HAS -A CLASS A
relationship between class A and String class is has-a
relationship between class A and class c is has-a
2>If a class extends a class or implements a interface then relationship
between those class or interface is known as is-a relationship
class A{
}
class B extends A{
}
relationship between class A and class B is is-a
READ THIS AS CLASS B IS A TYPE OF CLASS A
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---