What is IS-A relationship in java

‘Has a ‘ relationship is also known as “composition or Aggregation”. 
As in inheritance we have ‘extends’ keyword we don’t have any keyword to 
implement ‘Has a’ relationship in java. The main advantage of ‘Has-A‘ 
relationship in java code reusability. For has a relationship we use new keyword

Ex: Car has an engine. We cannot say Car in an engine.

0
10
A-312 69370 points

                                    ‘is a’ relationship is also known as inheritance. We can implement 
‘is a’ relationship or inheritance in java using extends keyword. 
The advantage of inheritance or is a relationship is reusability of code 
instead of duplicating the code.
  
Ex : 
Motor cycle is a vehicle
Car is a vehicle 
Both, car and motorcycle extends vehicle.

0
0
3.83
6
Awgiedawgie 440220 points

                                    public class Actress extends Person {        public String readScript(String movie) {        return "Reading the script of " + movie;    }         // additional methods/constructors}

3.83 (6 Votes)
0
Are there any code examples left?
Create a Free Account
Unlock the power of data and AI by diving into Python, ChatGPT, SQL, Power BI, and beyond.
Sign up
Develop soft skills on BrainApps
Complete the IQ Test
Relative searches
is-a and has-a relationship in java how to write has a relationship example in java is - a relationship in java is a has a relationship in java has-a relationship in java class diagram has a is a and contains relationships in java has a relationship keyword in java is and has a relationship in java has a and is a relationship in java has relationship in java has a relationship in java is called java is-a and has-a relationship is and has relationship in java has a relationship example in java has-a relationship in java example has and have relationship in java has a and is a relationship java is-a relationship association in java has a is a relationship java has-a relationship java example has a relationship ina java is a and has a relationship in java how to do in java is a and has a relationship in java o7planning is a kind of relationship in java is a relationship and has a relationship in java What is Is-a and Has-a relationship in Java 3. What is Is-a and Has-a relationship in Java has a relationship in java has-a relationship java association relationship and has-a relationship java has a relationship in java example how to use has-relationship in java code wgat are has-a relationships in java JAVa has a relation has a relationship example program in java types of has a relationship in java what is is a relationship and has a relationship in java has-a relationship in java is based on isa java has a relationship in c++ inheritance represents an is-a relationship has-a is-a java has a relationship java example what is has-a relationship isa hasa java car code example isa hasa java car java isa hasa relationship isa vs has a relationship inheritance is called is a relationship or has a relationship difference between is-a and has-a relationship in java is a relationship vs has a relationship in java is a relationship vs has a relationship how implement relationship in jav IS_A relationship in java is realeted to is a relationship in java example can i use a # in java java is a vs has a how to implement a has a relationship java has a relationship represent or relationship in a class java what is is-a relationship what is an is-a relationship in java What is “is-a” relationship mean? HAS-A relationships are based on inheritance, rather than usage. what is a is-a relationship what is a has-a relation in java java has-a relationship what is term is used to describe the has-a relationship between two classes is a relationship is-a relationship what is has-a relationship in java is-a vs has-a java is a relation ship java HAS-A relationship has-a relationship in java What is IS-A relationship in java Composition is a “has-a” relationship. java is-a relationship java has a vs is a is a vs has a java extends is a relationship or has a relationship java extends is a relationship java has a relationship what is has a relationship in java is a has a relationship in java example is a has a relationship is a relationship has a relationship java has a in java is a and has a relationship java is a relationship Relationships (IS-A and HAS-A) in Java IS A in java' has-a and is-a relationship in java has relation implementation has a relationship in java is a relationship java is a relationshoip in java is a and has a relationship in java java is a has a implement is a HAS A in java? has a relationship java what is a is-a relationship in java is-a relationship in java is-a relationship java is a relationship in java is a has a relationship java
Made with love
This website uses cookies to make IQCode work for you. By using this site, you agree to our cookie policy

Welcome Back!

Sign up to unlock all of IQCode features:
  • Test your skills and track progress
  • Engage in comprehensive interactive courses
  • Commit to daily skill-enhancing challenges
  • Solve practical, real-world issues
  • Share your insights and learnings
Create an account
Sign in
Recover lost password
Or log in with

Create a Free Account

Sign up to unlock all of IQCode features:
  • Test your skills and track progress
  • Engage in comprehensive interactive courses
  • Commit to daily skill-enhancing challenges
  • Solve practical, real-world issues
  • Share your insights and learnings
Create an account
Sign up
Or sign up with
By signing up, you agree to the Terms and Conditions and Privacy Policy. You also agree to receive product-related marketing emails from IQCode, which you can unsubscribe from at any time.
Creating a new code example
Code snippet title
Source