![UML Diagram to JAVA code [problem 1] 3 UML Diagram to JAVA code [problem 1] 1](https://old.nurnobishanto.com/wp-content/uploads/2019/10/Problem1_UML_Diagram.jpg)
Human Class Source code
public class Human {
protected String scientificName;
public Human(String scientificName)
{
this.scientificName = scientificName;
}
public void display()
{
System.out.println("Scientific Name:"+scientificName);
}
}
Item Class source code
public class Item {
public int itemId;
public String itemName;
public Item(int itemId,String itemName)
{
this.itemId=itemId;
this.itemName=itemName;
}
public void display()
{
System.out.println("Item ID:"+itemId+"\n"+"Item Nmae :"+itemName);
}
}
Customer Class Source code
public class Customer extends Human {
public int id;
public String name;
Item item;
public Customer(String scientificName,int id,String name,Item item)
{
super(scientificName);
this.id=id;
this.name=name;
this.item=item;
}
public void display()
{
super.display();
System.out.println("ID :"+id+"\n"+"Name:"+name);
item.display();
}
public static void main(String[] args)
{
Item itm =new Item(1020,"GPU");
Customer cmr = new Customer("graphics card",805,"Rahim",itm);
cmr.display();
}
}
![UML Diagram to JAVA code [problem 1] 4 UML Diagram to JAVA code [problem 1] 2](https://old.nurnobishanto.com/wp-content/uploads/2019/10/Problem1_Output.jpg)
- UML[ 03 ] Code with Abstract and Interface
- UML[ 02 ] Code with Abstract and Interface
- UML[ 01 ] Code with Abstract and Interface
- UML Diagram to JAVA code [problem 5]
- UML Diagram to JAVA code [problem 4]