欢迎来到天天文库
浏览记录
ID:38693695
大小:131.00 KB
页数:13页
时间:2019-06-17
《吐血共享我的java学习代码笔记》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库。
1、intmax=Integer.MAX_VALUE;//求出最大值System.out.println("整型的最大值:"+max);charch1='a';//字符是使用”'“括起来的数据charch2=97;//通过数字定义字符变量charch1='"';//表示的是一个"charch2='\';//表示的是一个、floatnum=3.0f;//定义一个浮点型变量booleanflag=true;//定义布尔型变量System.out.println("flag="+flag);//打印输出Stringstr="lixinghua";//定义字符串变量int
2、x=30;str=str+x;//修改str的内容并将内容重新给str变量publicstaticvoidmain(Stringargs[]){for(inti=0;i<10;i++){if(i==3){continue;}System.out.println("i="+i);结果:没有i=3if(x%2==1){//判断于是是否为1System.out.println("x是奇数!");//如果余数为1表示奇数max=x>y?x:y;//通过三目运算符求出最大值intscore[]=null;//声明数组score=newint[3];//为数组开辟空间,大小为
3、3System.out.println("数组长度为:"+score.length);intscore[]={91,92,93,94,95,96};//使用静态初始化声明数组for(intx=0;x4、/保存数组中的最小值max=min=score[0];for(intx=0;xmax){max=score[x];}elseif(score[x]5、1;i6、re[0][1]=30;//为数组中的内容赋值score[1][0]=31;//为数组中的内容赋值score[2][2]=32;//为数组中的内容赋值score[3][1]=33;//为数组中的内容赋值score[1][1]=30;//为数组中的内容赋值for(inti=0;i7、]){intscore[][]={{67,61},{78,89,83},{99,100,98,66,95}};//静态初始化完成,每行的数组元素个数不一样1for(inti=0;i8、;//静态
4、/保存数组中的最小值max=min=score[0];for(intx=0;xmax){max=score[x];}elseif(score[x]5、1;i6、re[0][1]=30;//为数组中的内容赋值score[1][0]=31;//为数组中的内容赋值score[2][2]=32;//为数组中的内容赋值score[3][1]=33;//为数组中的内容赋值score[1][1]=30;//为数组中的内容赋值for(inti=0;i7、]){intscore[][]={{67,61},{78,89,83},{99,100,98,66,95}};//静态初始化完成,每行的数组元素个数不一样1for(inti=0;i8、;//静态
5、1;i6、re[0][1]=30;//为数组中的内容赋值score[1][0]=31;//为数组中的内容赋值score[2][2]=32;//为数组中的内容赋值score[3][1]=33;//为数组中的内容赋值score[1][1]=30;//为数组中的内容赋值for(inti=0;i7、]){intscore[][]={{67,61},{78,89,83},{99,100,98,66,95}};//静态初始化完成,每行的数组元素个数不一样1for(inti=0;i8、;//静态
6、re[0][1]=30;//为数组中的内容赋值score[1][0]=31;//为数组中的内容赋值score[2][2]=32;//为数组中的内容赋值score[3][1]=33;//为数组中的内容赋值score[1][1]=30;//为数组中的内容赋值for(inti=0;i7、]){intscore[][]={{67,61},{78,89,83},{99,100,98,66,95}};//静态初始化完成,每行的数组元素个数不一样1for(inti=0;i8、;//静态
7、]){intscore[][]={{67,61},{78,89,83},{99,100,98,66,95}};//静态初始化完成,每行的数组元素个数不一样1for(inti=0;i8、;//静态
8、;//静态
此文档下载收益归作者所有