会员
众包
新闻
博问
闪存
赞助商
HarmonyOS
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
大灰狼21
博客园
首页
新随笔
联系
订阅
管理
上一页
1
···
16
17
18
19
20
21
22
23
下一页
2022年1月13日
idea文件存放位置
摘要: .java文件存放位置:D:\IdeaProjects\JavaSe_Code\idea_test\src\com .class文件存放位置:D:\IdeaProjects\JavaSe_Code\out\production\idea_test\com\itheima 在idea里输出栏的最后
阅读全文
posted @ 2022-01-13 17:40 大灰狼21
阅读(3311)
评论(0)
推荐(0)
2022年1月12日
循环猜数
摘要: Random r=new Random(); int number=r.nextInt(100)+1; while(true){ Scanner sc=new Scanner(System.in); System.out.println("请输入你猜的数字:"); int guessNumber=s
阅读全文
posted @ 2022-01-12 14:14 大灰狼21
阅读(46)
评论(0)
推荐(0)
Scanner数据输入
摘要: import java.util.Scanner; Scanner sc=new Scanner(System.in); int i=sc.nextInt();
阅读全文
posted @ 2022-01-12 14:03 大灰狼21
阅读(30)
评论(0)
推荐(0)
Random随机数
摘要: //10个人有放回抽取0-9中10个数 import java.util.Random; Random r=new Random(); for(int i=1;i<=10;i++){ int number=r.nextInt(10); //取值范围[0,10) //左闭右开区间 System.out
阅读全文
posted @ 2022-01-12 14:01 大灰狼21
阅读(17)
评论(0)
推荐(0)
遍历时分循环嵌套
摘要: for(int hour=0;hour<24;hour++){ for(int minute=0;minute<60;minute++){ System.out.println(hour+"时"+minute+"分"); } System.out.println(" "); }
阅读全文
posted @ 2022-01-12 13:51 大灰狼21
阅读(30)
评论(0)
推荐(0)
语句结构
摘要: 语句:顺序语句 分支语句if、switch 循环语句for、while、do...while
阅读全文
posted @ 2022-01-12 13:50 大灰狼21
阅读(180)
评论(0)
推荐(0)
continue、break跳转控制
摘要: continue:跳过某次,继续下次 break:终止循环体,结束循环
阅读全文
posted @ 2022-01-12 13:34 大灰狼21
阅读(39)
评论(0)
推荐(0)
while、for、do while循环的选择
摘要: while适合不知道循环次书时用 for适合知道循环次数时用 do while不管对不对先执行一次 whiel和for先判断再执行 for循环的i如果不在循环外接收无法使用 while循环的i由于在循环外先初始化了可以使用 死循环 for(;;){ } while(true){ //三种死循环里最常
阅读全文
posted @ 2022-01-12 13:03 大灰狼21
阅读(104)
评论(0)
推荐(0)
三位数每位数字提出来方法
摘要: 371 个位数:371%10=1 百位数:371/100=3 十位数:371/10=37 37%10=7 推广到任意数: 123456789要得到5 先把5移动到个位 再取余 于是371 取各位实际上完整的是: 个位371/1%10=1 十位371/10%10=7 百位371/100%10=3
阅读全文
posted @ 2022-01-12 13:00 大灰狼21
阅读(1021)
评论(0)
推荐(0)
switch语句
摘要: switch(表达式){ case 值1: 语句1; break; case 值2: 语句2; break; ... default: 语句n+1; [break;]//表示break可不写 } 表达式:byte、short、int、char JDK5后可以是枚举 JDK7后可以是String ca
阅读全文
posted @ 2022-01-12 12:46 大灰狼21
阅读(118)
评论(0)
推荐(0)
上一页
1
···
16
17
18
19
20
21
22
23
下一页
公告