What is the is a and has a relation ship in oops concept in
java?
Answer Posted / raghava
OOOOOO!NOooooooooo.
is a relationship is (inheritence)
has a relationship is (composition or Assocation)
Example:
Has a relation
public class Address
{
String street;
String city;
.......
}
public class Person
{
String name;
Address address; //has a relationship
}
| Is This Answer Correct ? | 82 Yes | 6 No |
Post New Answer View All Answers
Garbage collection in java?
How do you get length in java?
What is a consumer in java?
What is definition and declaration?
What is a parameter in simple terms?
What does flagged out mean?
Can a main method be overloaded?
What are the three parts of a lambda expression? What is the type of lambda expression?
What are the ways to instantiate the class class?
Are functions objects in java?
Explain what access modifiers can be used for methods?
What are 3 data types?
Why we override equals() method?
What do you mean by local variable and instance variable?
Which collection does not allow duplicates in java?