摘要: /** * 字符串连接符:字符串和字符串拼接 字符串和其他类型拼接 * //问:当多个类型参与的运算,+是运算?还是拼接? */ public static void main(String[] args) { //1.字符串类型:String String s = "可以任意写,写什么都是对的"; 阅读全文
posted @ 2022-03-21 21:38 涐啝雨の約定 阅读(27) 评论(0) 推荐(0)
摘要: public static void main(String[] args) { //1. ==:表示==号左右两边的数值或者结果是否相等 int i = 1; int j = 1; System.out.println(i == j); //2.逻辑运算符 // &&与运算:两个条件同时满足 in 阅读全文
posted @ 2022-03-20 21:47 涐啝雨の約定 阅读(36) 评论(0) 推荐(0)
摘要: public static void main(String[] args) { //1.算术运算符 %(取模或者取余) //当%前面的数字比后面的数字小时,余数为其本身 int i = 2 % 3;//2 int i2 = 5 % 2;//1 System.out.println(i); Syst 阅读全文
posted @ 2022-03-20 21:46 涐啝雨の約定 阅读(35) 评论(0) 推荐(0)
摘要: public class TestChange { public static void main(String[] args) { //1.自动类型转换; double d = 1;//double = int ;小->大 System.out.println(d); //2.强制类型转换 int 阅读全文
posted @ 2022-03-20 21:45 涐啝雨の約定 阅读(39) 评论(0) 推荐(0)
摘要: public static void main(String[] args) { //1.boolean赋值 boolean flag = true; boolean flag1 = false; //2.boolean可以进行逻辑运算 //例子:判断是否成年 int age = 25; boole 阅读全文
posted @ 2022-03-20 10:17 涐啝雨の約定 阅读(20) 评论(0) 推荐(0)
摘要: public static void main(String[] args) { //1.long的直接量,需要在熟知的末尾添加l和L long i = 2147483648l;//-2147473648~2147483647 long a = 1; long b = 1l; //a和b有什么区别呢 阅读全文
posted @ 2022-03-20 10:17 涐啝雨の約定 阅读(50) 评论(0) 推荐(0)
摘要: public static void main(String[] args) { //1.类型赋值 //a.赋值整数--对应Ascii码 char a = 66;//B char b = 97;//a System.out.println(a); System.out.println(b); //b 阅读全文
posted @ 2022-03-20 10:16 涐啝雨の約定 阅读(29) 评论(0) 推荐(0)
摘要: public static void main(String[] args) throws InterruptedException { //1.获取运行前的时间 long startTime = System.currentTimeMillis(); //2.需要计算运行时间的程序 Thread. 阅读全文
posted @ 2022-03-20 10:16 涐啝雨の約定 阅读(31) 评论(0) 推荐(0)
摘要: public static void main(String[] args) { //1.小数的科学计数方式 double d1 = 1.25E2; double d2 = 1.25e2;//1.25*10^2 double d3 = 1.25e-2;//1.25*10^-2 System.out. 阅读全文
posted @ 2022-03-20 10:16 涐啝雨の約定 阅读(30) 评论(0) 推荐(0)