Question: Java Language Instructions- Write detailed pseudo code for this code. I Will Thumbs Up /**Explanation The example shown here for Course is aggregation i.e. Has-A
Java Language
Instructions- Write detailed pseudo code for this code.
I Will Thumbs Up
/**Explanation
The example shown here for "Course" is aggregation i.e. "Has-A" relationship where Course has a textbook and an instructor. While the one where superclass and subclass comes into picture is "IS-A" relationship i.e.Inheritance in java.
In case of Aggregation, like here Course has objects of other two classes. While in required example the Vehicle class will be used as superclass and Motorcycle and Bus is a vehicle , hence these will extend from Vehicle. Also, you have shown me Car properties here which is not supposed to be a Class as mentioned by you as per question.
Understanding the question, I am showing an example for Inheritance i.e. "IS-A" relationship here using Vehicle, Car and Bus classes.
*/




UML Diagrams :-

2 3 public class Vehicle ( 4 5 String type; 6 int numofwheels; 7 8e Vehicle() 9 10 12public String toString()f 13 return "Vehicle type is" type " with Number Of Wheels"+numofwheelst"."; 14 15 16 2 3 public class Vehicle ( 4 5 String type; 6 int numofwheels; 7 8e Vehicle() 9 10 12public String toString()f 13 return "Vehicle type is" type " with Number Of Wheels"+numofwheelst"."; 14 15 16
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
