Professional Documents
Culture Documents
Ecomerse
Ecomerse
}
public void setCpu(int cpuSpeed){
this.cpu=cpuSpeed;
}
public int getCpuSpeed(){
return cpu;
}
public void setMemory(int memory){
this.memory=memory;
}
public int getMemory(){
return memory;
}
}
arr.print();
}
}
}
package assignment;
public class Laptop extends Computer {
private double displaySize;
}
@Override
public void print(){
System.out.println("Brand :"+this.getBrand()+" Price :"+"$"+this.getPrice()+"
Warranty :"+this.getWarranty()+" month "+
" cpu speed :"+this.getCpuSpeed()+"HZ "+" Memory :"+this.getMemory()+"mb "+"Display
size :"+displaySize);
}
}
}
}
package assignment;
public class Electronic {
private String brand;
private double price;
private int warranty;
public void print(){
System.out.println("brand :"+brand);
System.out.println("price :"+price);
System.out.println("warranty :"+warranty);
}
public Electronic() {
}
public void setBrand(String brand){
this.brand=brand;
}
public String getBrand(){
return brand;
}
public void setPrice(int price){
this.price=price;
}
public double getPrice(){
return price;
}
public void setWarranty(int warranty){
this.warranty=warranty;
}
public int getWarranty(){
return warranty;
}
}