命令行传参 1.在命令行中给main()方法传参 package com.zmq.method; public class DemoTwo { public static void main(String[] args) { //args.length数组长度 for (int i = 0; i < args.length; i++) { System.out.println("args["+i+"]:"+args[i]); } } } } }