main數組演示:java
public class Main { public static void main(String[] args) { // TODO Auto-generated method stub System.out.println(args); System.out.println(args.length); for(int i=0; i<args.length; i++){ System.out.println(args[i]); } } }
運行結果數組
[Ljava.lang.String;@1db9742 0
main方法做用演示代碼:code
public class Main { public static void main(String[] args) { for(int i=0; i<args.length; i++){ System.out.println(args[i]); } } }
編譯後運行結果:編譯