Question: java We have written the following abstract Machine class: abstract class Machine { // abstract instance method declarations public abstract int getMemory(); public abstract int
We have written the following abstract Machine class: abstract class Machine { // abstract instance method declarations public abstract int getMemory(); public abstract int getDisplayWidth(); public abstract int getDisplayHeight(); We have also written the following Laptop class: class Laptop extends Computer { // instance variables int displayWidth = 1920; int displayHeight = 1080; // instance method definitions public int getDisplayWidth() { return this.displayWidth: public int getDisplayHeight() { return this.displayHeight; TASK: Create an abstract class called Computer that has the following properties: It must extend the Machine class It must implement the getMemory instance method such that it returns the integer 128 Write a program, test using stdin stdout
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
