技术在使用中提高,最简单的hello world代码,用java来表达。第一行 class 后面的名字,就是文件名的前半部分,第二行public 代表作用域为所有,公开,static表示不用实例化hello类,就可以调用main方法,void表示没有返回,String[] 表示程序的命令行参数字符串数组(因为一切都是对象,String可以统计数组的元素个数,通过下标可以访问具体元素,所以,这个参数就不需要c语言的两个参数,一个是命令行参数个数int argc ,一个是具体的参数,char** argv)args是数组名,约定成俗叫这个,你也可以叫ergouzi,编译通过没问题。最后的Ststem.out.println();类似于printf();不再说明。
kioohe Goto Github PK
Name: 时空旅者
Type: User
Bio: 在本世寻找真我,