主题:[讨论]有个问题帮忙看哈谢谢
public class Test
{
public static String green;
public static boolean on;
public static void main(String args[])
{
Fan f=new Fan();
f.setspeed(10);
f.setradius(10);
f.setcolor(green);
f.seton(on);
System.out.println(f.tostring());
}
}
改成了
public class Test
{
public static void main(String args[])
{
[color=FF0000]String green;
boolean on;[/color]
Fan f=new Fan();
f.setspeed(10);
f.setradius(10);
f.setcolor(green);
f.seton(on);
System.out.println(f.tostring());
}
}
后运行为什么就说上面两个变量没有被实例化
{
public static String green;
public static boolean on;
public static void main(String args[])
{
Fan f=new Fan();
f.setspeed(10);
f.setradius(10);
f.setcolor(green);
f.seton(on);
System.out.println(f.tostring());
}
}
改成了
public class Test
{
public static void main(String args[])
{
[color=FF0000]String green;
boolean on;[/color]
Fan f=new Fan();
f.setspeed(10);
f.setradius(10);
f.setcolor(green);
f.seton(on);
System.out.println(f.tostring());
}
}
后运行为什么就说上面两个变量没有被实例化