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


Please Help Members By Posting Answers For Below Questions

What is t type java?

616


How to print nodes of a Binary tree?

1746


Explain about abstract classes in java?

572


Why do we need hashset in java?

484


How will you calculate the depth of a binary tree if the tree contains 15 nodes?

589






What are singleton services?

483


Why do we need data structure in java?

560


What is the difference between normal report & matrix report?

555


Does variable declaration allocate memory?

573


Explain methods specific to list interface?

543


Does garbage collection occur in permanent generation space in jvm?

591


Is minecraft 1.15 out?

538


Why do we create public static method in java?

569


In how many ways we can create threads in java?

617


How do I find and replace in word?

526