abstract class powerable int powerLvl int needeblePower class Power pu

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
abstract class powerable{
int powerLvl;
int needeblePower;
}
class Power{
public static void setPower(powerable device){
device.powerLvl=200;
System.out.println("after changing "+device.needeblePower);
}
class Motherboard extends powerable{
public int powerLvl;
public int needeblePower=200;
public void powerOn(){
Power.setPower(this);
System.out.println("in class MotherBoard "+powerLvl);