首页
IT
登录
6mi
u
盘
搜
搜 索
IT
java基本编程
java基本编程
xiaoxiao
2021-03-25
76
一:定义数组
数组的元素类型 数组名[ ];
数组的元素类型[ ] 数组名;
例:int a[ ]; a=new int [10]; int [ ] a; a=new int [10]; int a[ ]=new int [10];
以上都是等价的
二:编程的格式 class Hello{
public static void main(String args[]){
System.out.println("你好");
} }
三:输出1到100的和 class Example{
public static void main(String argd[]){
int s=0;
for(int i=1;i<=100;i++){
s=s+i;
}
System.out.println(s);
} }
转载请注明原文地址: https://ju.6miu.com/read-34471.html
技术
最新回复
(
0
)