X805: OOP Create Array

For this question assume the following implementations of Computer, Tablet, and Notebook

public class Computer {
    private String manufacturer;
    private String processor;
    private int ramSize;
    private int diskSize;
    private double processorSpeed;

    public Computer(String man, String pro, int raSize, int diSize, double proSpeed) {
        manufacturer = man;
        processor = pro;
        ramSize = raSize;
        diskSize = diSize;
        processorSpeed = proSpeed;
    }

     ...

}

public static class Tablet extends Computer{
    private int length;
    private int width;
    private String operatingSystem;

    public Tablet(String man, String pro, int raSize, int diSize, double proSpeed, int len, int wid, String os) {
        super(man, pro, raSize, diSize, proSpeed);
        length = len;
        width = wid;
        operatingSystem = os;
    }
     ...
}


public class Notebook extends Computer{
    public Notebook(String man, String pro, int raSize, int diSize, double proSpeed) {
        super(man, pro, raSize, diSize, proSpeed);
    }
}

For this question, the following method is supposed to return an array of the objects defined in order at the beginning of the array. Add the return type and create and return the array.

Your Answer:

Reset

Practice a different Java exercise

Feedback

Your feedback will appear here when you check your answer.