Question: programming language : java 1. Create a Node class with: a. Two attributes that store the id (int) and the serial number (String) b.toString() method
1. Create a Node class with: a. Two attributes that store the id (int) and the serial number (String) b.toString() method which returns a String with the id and the serial number 2. Extend a Server class from the Node class with: a. One attribute, vmNum that shows the number of virtual machines hosted on the server b. Override the toString() method of the Node class to return the VmNb along with the id and serial number. 3. Extend a Switch class from the Node class with: a. One attribute, the portsNb that represents the number of ports of the switch b. Override the toString() method of the Node class to return the portsNb along with the id and serial number. 4. Create a Driver class that: a. Creates an array of two Nodes b. Creates a Server and stores it in the array c. Creates a Switch and stores it in the array d. Iterates over the array and prints the information of the two nodes by calling the toString() method
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
