小虾米资讯

AD1
当前位置:网站首页 / android / 正文

android:java/python爱好者,有同志趣的+q449047677

2021-11-24 00:40:30 / 我要吐槽 查看是否已被百度收录 查看是否已被谷歌收录 查看是否已被搜狗收录 查看是否已被360收录
AD2
小白学习中,每日手写一贴 ,促进自己进步,欢迎大家提出建议(2021.8.13) 1.输出3,6,78,8888,655,46,778,88的最大值、最小值、算出平均值并求和。public class August132021{public static void main(String[] args){ int [] array= {3,6,78,8888,655,46,778,88};//静态数组简写 int max=array[0];//定义最大的数组内数据从第一个开始 int min=array[0]; int avg=0; int sum=0;for (int i=0;i<array.length;i++){//数组内循环if ( array[i]>max){max=array[i];}if (array[i]<min){min=array[i];}sum=sum+array[i];//求和avg=sum/array.length;//求平均值}System.out.println("最大值:"+max);//打印输出System.out.println("最小值:"+min);System.out.println("求和:"+sum);System.out.println("平均值:"+avg); }}

public class August142021 {public static void main(String[] args) {int [] array={1,3,5,7,9,11,13};for (int i = 0; i <array.length ; i++) {System.out.println(array[i]);}System.out.println("=============");for (int min=0,max=array.length-1; min <max ; min++,max--) {int temp=array [min];array[min]=array[max];array[max]=temp;}for (int i = 0; i <array.length ; i++) {System.out.println(array[i]);}}}

2021年8月15日: public class Book{String name;int age;int thickness;String type;public void fanshu(String what) {System.out.println("看"+what+"书");}public void takenotes(){System.out.println( "做笔记");}}public class ReadBook{public static void main(String[] args){Book read= new Book();read.name="大优秀";read.age=33;read.thickness=266;read.type="工程类";System.out.println(read.name);System.out.println(read.age);System.out.println(read.thickness);System.out.println(read.type);System.out.println("===================");read.fanshu("怎么建房子");read.takenotes();}}

2021-8-16键盘输入计算最大值;public class August162021{ public class static void main(String[] args){Scanner sc=new Scanner(System.in);System.out.println("请输入第一个数:")int a=sc.nextInt();System.out.println("请输入第二个数:")int b=sc.nextInt(System.out.println("请输入第二个数:")int c=sc.nextInt();int temp=a>b?a:b;int max=c>temp?c:temp;System.out.println("最大值是:");}

猜数字小游戏 今天效率还可以 继续努力,纯手打 public class August172021{ public static void main(String[] args) {Random r=new Random();//new 一个新的随机类int randomNum=r.nextInt(100)+1; //定义这个类在1-100内运转Scanner sc=new Scanner(System.in);//键盘输入数据while (true){//判断语句为真System.out.println("请输入你猜的数字");int guessNum=sc.nextInt();//键盘输入猜的数字if(guessNum>randomNum){System.out.println("你猜的数字太大了");}else if (guessNum<randomNum){System.out.println("你猜的数字太小了");}else{System.out.println("恭喜你猜对了!");break;//如果猜中 不再重试}}}}

今日去工地现场淋了很多雨,脑袋发热睡了public class August182021{public static void main(String[] args) {// 首先创建一个长度为3的数组,里面用来存放person类型的对象person[] array = new person[3];person one = new person("迪丽热巴", 18);person two = new person("古力娜扎", 28);person three = new person("玛尔扎哈", 38);// 将one当中的地址值赋值到数组的0号元素位置array[0] = one;array[1] = two;array[2] = three;System.out.println(array[0]); // 地址值System.out.println(array[1]); // 地址值System.out.println(array[2]); // 地址值System.out.println(array[1].getName()); // 古力娜扎}}

今天异常顺利,美好的一天,今日题目:在1-100选出任意20个数,并指出偶数的个数。public class August192021{public static void main(String[] args) {ArrayList<Integer> bigList = new ArrayList<>();//新建一个数据类Random r = new Random();//新建一个随机类for (int i = 0; i < 20; i++) {//在1-100遍历20次int num = r.nextInt(100) + 1; // 1~100bigList.add(num);//将1-100的数组里的数字添加进去}ArrayList<Integer> smallList = getSmallList(bigList);//小集合将提取大集合中的中的数据System.out.println("偶数总共有多少个:" + smallList.size());for (int i = 0; i < smallList.size(); i++) {System.out.print(smallList.get(i));}}// 这个方法,接收大集合参数,返回小集合结果public static ArrayList<Integer> getSmallList(ArrayList<Integer> bigList) {// 创建一个小集合,用来装偶数结果ArrayList<Integer> smallList = new ArrayList<>();for (int i = 0; i < bigList.size(); i++) {int num = bigList.get(i);if (num % 2 == 0) {smallList.add(num);}}return smallList;}}

今天很累就是睡不着也学不进去,明天休息一天放空自己。四种字符串的创建public class August202021 {public static void main(java.lang.String[] args) {// 使用空参构造网页链接 str1=new java.lang.String();System.out.println("第1个字符串:" + str1);// 根据字符数组创建字符串char[] charArray={'d','f','t'};网页链接 str2= new java.lang.String(charArray);System.out.println("第2个字符串:" + str2);// 根据字节数组创建字符串byte[] byteArray={56,78,89};网页链接 str3=new java.lang.String(byteArray);System.out.println("第3个字符串:" + str3);// 直接创建网页链接 str4="超级大优秀";System.out.println("第4个字符串:" + str4);}}

今天和老婆孩子去卡乐水上乐园,机缘巧合之下跟一20多岁的女孩共同完成一个高空划水。说实话是一个正常男人和穿着比基尼的女孩子互动都会有点心动的,但是没有歪心思,不然就问电话号码了。说这些是证明自己老了,30好几时间不多了。要更好的把握好时间。抓紧时间努力学习,创造更多价值,尽量让老婆孩子过好点。public class August212021 {public static void main(String[] args) {//键盘输入一个字符串Scanner sc=new Scanner(System.in);System.out.println("请输入字符串数组:");String input=sc.next();//定义大小写数字及其他int countUpper = 0;int countLower=0;int countNumber=0;int countOther=0;//条件判断char [] charArray=input.toCharArray();//将字符数组输入for (int i = 0; i <网页链接 ; i++) {char ch=charArray[i];if('A'<=ch&&ch<='Z'){countUpper++;}else if('a'<=ch&&ch<='z'){countLower++;}else if('0'<=ch&&ch<='9'){countNumber++;}else {countOther++;}}//打印输出大小写数字及其他System.out.println("大写字母有:"+countUpper);System.out.println("小写字母有:"+countLower);System.out.println("数字有:"+countNumber);System.out.println("其他字母有:"+countOther);}}

今日总结:人的精力确实有限的,晒了一天回来就累趴下了!回来想写程序怎么都写不了了。一定要突出重点,搞完这个工地绝不再个人接资料做任何事情!

昨天喝冰水吃西瓜+晒了一天回来就腹泻将近20次,一天没吃饭,虚脱了。算某个区间内的绝对值个数public class August232021 {public static void main(String[] args) {int count=0; //从0开始计数double min=-12.8;double max=3.9;for (int i = (int)min; i <max; i++) {int abs= Math.abs(i);//定义绝对值等于数学计算法if(8.5<abs||abs<1.3){count++;System.out.println(i);}}System.out.println("总共有:"+count);

不想事情了早点睡觉父类子类的调用//子类public classTeacherextendsEmploree {}//子类public classAssistantextendsEmploree {}//父类public classEmploree {public voidmethod(){System.out.println("方法执行啦");}

今天干了好多零碎事,造价站,造价公司,孵化基地,给儿子学校报名,跑步2h,没有集中精力干这事了。明天继续加油吧!父类public class phone {public void call(){System.out.println("打电话");}public void send(){System.out.println("发短信");}public void show(){System.out.println("显示号码");}}接下来的打不出来了,太长了!!!

今天感觉还可以,明天继续努力!以前学的现在又忘了,年纪大了,更要加把劲哈,加油!!!//子类public class Newphone extends phone {@Overridepublic void show() {super.show();//把父类的show方法拿过来重复利用,自己子类再添加更多内容System.out.println("显示姓名");System.out.println("显示头像");}}public class phone {public void call(){System.out.println("打电话");}//父类public void send(){System.out.println("发短信");}public void show(){System.out.println("显示号码");}}//方法调用public class phoneMethod {public static void main(String[] args) {phone ph=new phone();ph.call();ph.send();ph.show();System.out.println("================");Newphone np=new Newphone();np.show();np.call();np.send();System.out.println("===============");}}

2021年8月27日 学习java2h昨天通宵看了一晚上理想之城,赵又廷和孙俪还有一大群演技派演的蛮好,主要是干工程的,产生蛮多共鸣,看这个电视还是值得学到了一点东西,今天脑袋昏了一天,荒废了一天学业,还有五个月,这辈子能不能实现自由就看这五个月的深度思考了。今天早点睡觉了,下半年进入满血战斗状态。备战高考的姿态完成既定的任务。近5个月舍弃所有抖音手机视频及电视,全身心投入目标。早6点起床晚11点熟睡。中午休息一小时,其余时间第一要务完成目标。

Powered By © 小虾米资讯 2015

(本站部分文章来源于网络或网友爆料,不代表本站观点,如有侵权请联系及时删除 )