谁来改改这个小程序~
public class Deng{
public static void main(String[] args)
{
aa a1=new aa();
a1.bb("白炽灯");
a1.cc(false);
a1.dd(3);
}
}
class aa
{
String zhonglei;
int liangdu;
boolean kaiguan;
String bb(String zhonglei)
{
this.zhonglei=zhonglei;
System.out.println("种类"+zhonglei);
return zhonglei;
}
boolean cc(boolean kaiguan)
{
this.kaiguan=kaiguan;
if(kaiguan=true)
{
System.out.println("开关:打开");
}
else
{
System.out.println("开关:关闭");
}
return kaiguan;
}
int dd(int liangdu)
{
this.liangdu=liangdu;
switch(liangdu)
{
case 1:System.out.println("台灯:微亮");
case 2:System.out.println("台灯:亮");
case 3:System.out.println("台灯:高亮");
}
return liangdu;
}
}
//问题,如果在台灯关闭的时候怎么让它在亮度中显示不亮。