摘要: 1.break public static void main(String[] args) { int i=0; while (i<100){ i++; System.out.println(i); if (i==30){ break;//break中止循环 } } System.out.prin 阅读全文
posted @ 2020-08-13 16:11 即食内鬼 阅读(202) 评论(0) 推荐(0)
摘要: 1.public class Demo01 { public static void main(String[] args) { //创建一个扫描器对象 用于接受键盘数据 Scanner scanner = new Scanner(System.in); System.out.println("使用 阅读全文
posted @ 2020-08-13 16:03 即食内鬼 阅读(378) 评论(0) 推荐(0)
摘要: public class demo8 { public static void main(String[] args) { /*三元运算符 x?y:z x==ture则输出为y否则输出z */ int score1=80; String type1=score1>60?"及格":"不及格"; Sys 阅读全文
posted @ 2020-08-13 16:00 即食内鬼 阅读(91) 评论(0) 推荐(0)
摘要: package com.study.www.base.base.operator;//逻辑运算符public class demo5 { public static void main(String[] args) { //与 and 或 or 非 nor boolean a=true; boole 阅读全文
posted @ 2020-08-13 15:59 即食内鬼 阅读(438) 评论(0) 推荐(0)
摘要: package operator;public class demo3 { public static void main(String[] args) { //关系运算符 结果为正确或者错误 true or false 布尔值来表示 int a=20; int b=10; int c=21; Sy 阅读全文
posted @ 2020-08-08 14:43 即食内鬼 阅读(193) 评论(0) 推荐(0)
摘要: package operator;public class demo1 { public static void main(String[] args) { //二元运算符 int a =10; int b =20; int c =25; int d =25; System.out.println( 阅读全文
posted @ 2020-08-08 14:02 即食内鬼 阅读(179) 评论(0) 推荐(0)
摘要: package base;public class demo8 { //类变量 static static double salary=2500; //属性:变量 //实例变量:从属于对象 如果不自行初始化,这个类型的默认值 0 0.0 //布尔值默认是false //除了基本类型,其余的默认值都是 阅读全文
posted @ 2020-08-08 14:00 即食内鬼 阅读(206) 评论(0) 推荐(0)
摘要: package base;public class demo4 { public static void main(String[] args) { int i=128; byte d=(byte)i;//输出不同 内存溢出 //强制转换 (类型)变量名 从高到低 //自动转换 从低到高 Syste 阅读全文
posted @ 2020-08-08 13:58 即食内鬼 阅读(219) 评论(0) 推荐(0)
摘要: package base;public class demo3 { public static void main(String[] args) { //java中表示进制 二进制0b 八进制0 十进制 十六进制0x int i1 = 10; int i2 = 010; int i3 = 0x10; 阅读全文
posted @ 2020-08-08 13:54 即食内鬼 阅读(147) 评论(0) 推荐(0)
摘要: public class demo2 { public static void main(String[] args) { //八大数据类型 //整数 int num1 = 10; //最常用 -2147483648-2147483647 占4个字节 byte num2 = 100; //-128- 阅读全文
posted @ 2020-08-08 13:53 即食内鬼 阅读(122) 评论(0) 推荐(0)