290114lyp

导航

2022年10月22日

扩展赋值运算符 条件运算符

摘要: package operator;public class Shabi7 { public static void main(String[] args) { int a=10; int b=20; a+=b;//a =a+b a-=b;//a =a-b a*=b;//a =a*b a/=b;//a 阅读全文

posted @ 2022-10-22 21:56 是芥末!日 阅读(18) 评论(0) 推荐(0)

逻辑运算符 位运算符

摘要: package operator;public class Shabi5 { public static void main(String[] args) { // 与(and) 或(or) 非(取反) boolean a=true; boolean b=false; System.out.prin 阅读全文

posted @ 2022-10-22 21:31 是芥末!日 阅读(17) 评论(0) 推荐(0)

自增 自减 幂运算

摘要: package operator;public class Sshabi4 { public static void main(String[] args) { //++ -- 自增 自减 一元运算符 int a=5; int b=a++;//执行完这行代码,先给b赋值,再自增 // a=a+1 S 阅读全文

posted @ 2022-10-22 20:51 是芥末!日 阅读(24) 评论(0) 推荐(0)

部分基本运算符

摘要: package operator; public class Shabi1 { public static void main(String[] args) { //二元运算符 //ctrl * d:复制当前到下一行 int a=10; int b=20; int c=25; int d=25; S 阅读全文

posted @ 2022-10-22 20:50 是芥末!日 阅读(20) 评论(0) 推荐(0)

变量 常量

摘要: public class shabi4 { //类变量 static static double salary =2500; //属性:变量 //实例变量:从属于对象;如果不自行初始化,这个类型的默认值 //布尔值:默认值是false //除了基本类型。其余的默认值都是null String nam 阅读全文

posted @ 2022-10-22 16:52 是芥末!日 阅读(17) 评论(0) 推荐(0)

类型转换

摘要: public class shabi1 { public static void main(String[] args) { int i =128; byte b =(byte)i;//内存溢出 //强制转换 (类型)变量名 高到低 System.out.println(i); System.out 阅读全文

posted @ 2022-10-22 15:49 是芥末!日 阅读(12) 评论(0) 推荐(0)