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

How many decimal digits is 64 bit?

536


What does yield method of the thread class do?

583


Explain the use of volatile field modifier?

638


What are the different types of multitasking?

660


What is ‘has a’’ relationship in java?

726






What are loops in java?

553


What are serialization and deserialization?

730


When to use runnable interface vs thread class in java?

526


What are methods in java?

542


Does java list allow null?

550


What are the principle concepts of oops?

539


How can I become a good programmer?

493


What is a class instance variable?

624


How do you compare values in java?

549


What is difference between adapter class and listener?

502