本帖最后由 寇龙飞 于 2012-7-28 13:47 编辑
- class MainDemo
- {
- public static void main(String[] args)//new String[]
- {
- String[] arr = {"hah","hhe","heihei","xixi","hiahia"};
- MainTest.main(arr);
- }
- }
- class MainTest
- {
- public static void main(String[] args)
- {
- for(int x=0; x<args.length; x++)
- System.out.println(args[x]);
- }
- }
复制代码- javac MainDemo.java
- java MainDemo
复制代码 能运行。如题,为什么可编译通过?
|
|