Search
 
SCRIPT & CODE EXAMPLE
 

JAVA

has 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.
Comment

is a and has a relationship in java

class Apple extends Fruit {

}
Comment

is a and has a relationship in java

class Room {

    Table table = new Table();

}
Comment

PREVIOUS NEXT
Code Example
Java :: java basic syntax 
Java :: inheritance in oop 
Java :: mapping over a list of promises in javaascript 
Java :: render problem in android studio 
Java :: one line if statement java 
Java :: calculate time java 
Java :: how to save a string to a text file 
Java :: crear objetos automaticamente java 
Java :: comentario java 
Java :: android menu change text color 
Java :: input long in java 
Java :: java program using FileOutputStream to create a file on mac 
Java :: nosuchelementexception 
Java :: java decompiler 
Java :: enhanced for loop with arraylist 
Java :: how to multiply bigdecimals 
Java :: hash table implementation java 
Java :: richest customer wealth leetcode 
Java :: imageview.setbackground 
Java :: remove duplicate from string 
Java :: bufferedinputstream 
Java :: binary to int java 
Java :: java ignore catch 
Java :: java char stream to string 
Java :: java convert pdf to image 
Java :: How to get a context in a recycler view adapter 
Java :: set matrix zeros 
Java :: can i have both java7 and java 11 in mac 
Java :: binary to decimal java 
Java :: Programme to calculate Combination 
ADD CONTENT
Topic
Content
Source link
Name
8+1 =