65 834
Assignments Done
99,1%
Successfully Done
In October 2018

Answer to Question #59511 in Java | JSP | JSF for Peter

Question #59511
Declares and create an array of 5 instances of Vehicle, two of which should be Dumpers, two of which should be Excavators and the other should be a Telehandler.

Dumper, Excavator and Telehandler are subclasses of Vehicle.
Expert's answer
package com.company;

public class Main {
public static class Vehicle{

}
public static class Dumpers extends Vehicle{

}
public static class Excavators extends Vehicle{

}
public static class Telehandler extends Vehicle{

}
static int sum(int a, int b) {
int total;
total = a + b;
return total;
}
public static void main(String[] args) {
Vehicle[] vehicle= {new Dumpers(), new Dumpers(), new Excavators(), new Excavators(), new Telehandler()};
}
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be first!

Leave a comment

Ask Your question

Submit
Privacy policy Terms and Conditions