OP08第八章Array.ppt

OP08第八章Array

d1 = 10.0 d2 = 20.0 d3 = 30.0 d4 = 40.0 Average of d1 and d2 is 15.0 Average of d1, d2 and d3 is 20.0 Average of d1, d2, d3 and d4 25.0 命令行参数 To pass arguments from the command line to an application by including a parameter of type String[] in the parameter list of main. By convention, this parameter is named args. The number of arguments = args.length 例如 java MyClass a b 运行后 args[0] = “a” args[1] = “b”. // Using command-line arguments to initialize an array. public class InitArray { public static void main( String args[] ) { // check number of command-line argume

文档评论(0)

1亿VIP精品文档

相关文档