摘要: Java的循环结构 while循环结构 先判断后循环 public class Demo09 { public static void main(String[] args) { //从1输入到100 int i = 0; //while (布尔表达式) {循环内容} while (i<100){ 阅读全文
posted @ 2021-03-04 23:52 默默努力的路人甲 阅读(39) 评论(0) 推荐(0)
摘要: Java的判断结构 if 单选择结构 import java.util.Scanner;​public class Demo04 { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); 阅读全文
posted @ 2021-03-03 18:24 默默努力的路人甲 阅读(105) 评论(0) 推荐(0)
摘要: Scanner整数,浮点数的应用 整数,浮点数的应用与前章相似,next后面的标注改为不同的类型即可 import java.util.Scanner;​public class Demo02 { public static void main(String[] args) { Scanner sc 阅读全文
posted @ 2021-03-03 15:14 默默努力的路人甲 阅读(100) 评论(0) 推荐(0)
摘要: 用户交互Scanner next()的用法 import java.util.Scanner;​public class Demo01 { public static void main(String[] args) { Scanner scanner = new Scanner(System.in 阅读全文
posted @ 2021-03-03 11:05 默默努力的路人甲 阅读(20) 评论(0) 推荐(0)
摘要: javaDoc文档的生成 Doc注释的主要参数信息 /***@author 作者名*@version 版本号*@since 指明需要最早使用的jdk*@param 参数名*@return 返回值情况*@throws 异常抛出情况*/ Doc注释的区分 package java学习;​/** * @a 阅读全文
posted @ 2021-03-02 18:50 默默努力的路人甲 阅读(42) 评论(0) 推荐(0)
摘要: java的包机制 java包的命名规则一般把公司名倒置 eg: www.baidu.com 倒置为com.baidu.com java包的导入 包导入时不能在包名前 错误 import java.util.Date; //在包名字package com.baidu;前package com.baid 阅读全文
posted @ 2021-03-02 17:55 默默努力的路人甲 阅读(45) 评论(0) 推荐(0)
摘要: += -= *= /= += public class Demo6 { public static void main(String[] args) { int a = 50; int b = 40; System.out.println(a+=b);//90 }}​ -= public class 阅读全文
posted @ 2021-03-01 15:54 默默努力的路人甲 阅读(40) 评论(0) 推荐(0)
摘要: 逻辑运算符 &&与运算符,同为true结果为true public class Demo5 { public static void main(String[] args) { boolean a = true; boolean b = false; boolean c = true; System 阅读全文
posted @ 2021-03-01 12:53 默默努力的路人甲 阅读(48) 评论(0) 推荐(0)
摘要: java中的自增自减和幂方写法 java中的自增 a++或++a public class Demo4 { public static void main(String[] args) { int a = 3; int b = a++; //++相当于a=a+1,但是a++是先给b赋值(b=未加时的 阅读全文
posted @ 2021-02-28 15:11 默默努力的路人甲 阅读(79) 评论(0) 推荐(0)
摘要: java基本运算符解析(1) 基本加减乘除间运算 public class Demo1 { public static void main(String[] args) { int a = 20; int b = 30; int c = 40; int d = 25; System.out.prin 阅读全文
posted @ 2021-02-28 10:21 默默努力的路人甲 阅读(53) 评论(0) 推荐(0)