Order the answer to: Appliance.java public class Appliance { //Declaring instance variables private String name; private

Academic Help net programming Order the answer to: Appliance.java public class Appliance { //Declaring instance variables private String name; private

net programming

Order the answer to: Appliance.java public class Appliance { //Declaring instance variables private String name; private

Question public class Appliance { //Declaring instance variables private String name; private String location; int value;
//Zero argumented constructor public Appliance() {}
//Parameterized constructor public Appliance(String name, String location, int value) { this.name = name; this.location = location; this.value = value; }
//getters and setters public String getName() { return name; }
public void setName(String name) { this.name = name; }
public String getLocation() { return location; }
public void setLocation(String location) { this.location = location; }
public int getValue() { return value; }
public void setValue(int value) { this.value = value; }
//toString method is used to display the contents of an objectinside it @Override public String toString() { return “The ” + name + ” is located in the ” + location; }
}
__________________

public class TV extends Appliance { //Declaring instance variables private int size; private int channel; private int volume; //Zero argumented constructor public TV() {
} //Parameterized constructor public TV(String name, String location, int value, int size, intchannel, int volume) { super(name, location, value); this.size = size; this.channel = channel; this.volume = volume; } //getters and setters public int getSize() { return size; } public void setSize(int size) { this.size = size; } public int getChannel() { return channel; } public void setChannel(int channel) { this.channel = channel; } public int getVolume() { return volume; } public void setVolume(int volume) { this.volume = volume; } //toString method is used to display the contents of an objectinside it @Override public String toString() { return “The ” + getName() + ” is located in the ” + getLocation() +” and is on channel ” + channel; }
}
_________________

public class Client {
public static void main(String[] args) {
//Creating an Instance of TV class object by passing the valuesas arguments
TV tv1=new TV(“Hitachi”,”Bedroom”,399,32,1215,0);
//Displaying the TV class info
System.out.println(tv1);
}
}
_________________

The Hitachi is located in the Bedroom and is on channel 1215

. . .

Subject net programming
Ready to try a high quality writing service? Get a discount here