对于public static void main(String args[])你知几何?
B. baz has value of null
C. baz has value of "Red"
D. baz has value of "Blue"
E. baz has value of "Green"
F. the code does not compile
G. the program throw an exception
Answer:G
5. main()方法只作为Java应用程序的入口。Applet程序不需要main()方法,一般由浏览器不同方式启动,其入口程序一般为init()方法。
6. main可作为普通方法名。
如:
public class Droitwich
{
class one
{
private class two
{
public void main() //注意这里的main方法
{
System.out.println("two");
}
}
}
}
显示:编译正常