• 博客园logo
  • 会员
  • 众包
  • 新闻
  • 博问
  • 闪存
  • 赞助商
  • HarmonyOS
  • Chat2DB
    • 搜索
      所有博客
    • 搜索
      当前博客
  • 写随笔 我的博客 短消息 简洁模式
    用户头像
    我的博客 我的园子 账号设置 会员中心 简洁模式 ... 退出登录
    注册 登录
 






xu529

 
 

Powered by 博客园
博客园 | 首页 | 新随笔 | 联系 | 订阅 订阅 | 管理
上一页 1 2 3 4 5 6

2022年7月22日

三元运算符 小结
摘要: package operator; public class sanyuan { public static void main(String[] args) { int a=10; int b=20; a+=b;//a=a+b System.out.println(a); a-=b;//a=a-b 阅读全文
posted @ 2022-07-22 11:46 7号彩虹 阅读(28) 评论(0) 推荐(0)
 
逻辑运算符,位运算符
摘要: package operator; public class panduan { public static void main(String[] args) { boolean a =false; boolean b =true; System.out.println(a&&b);//false 阅读全文
posted @ 2022-07-22 11:12 7号彩虹 阅读(41) 评论(0) 推荐(0)
 

2022年7月21日

自增自减运算符 初识Math
摘要: package operator; public class zhengjian { public static void main(String[] args) { //++ -- 自增,自减 一元运算符 int a=3; int b=a++;//先把a赋值给b,再算a自增 // a=a+1 in 阅读全文
posted @ 2022-07-21 12:37 7号彩虹 阅读(25) 评论(0) 推荐(0)
 

2022年7月20日

运算符
摘要: 注意: 1.%(取余数):模运算 2.赋值不是等于 java中用==表示等于 3.逻辑运算符:与或非 package base; public class bianliang { public static void main(String[] args) { //二元运算符 //Ctrl+D:复制 阅读全文
posted @ 2022-07-20 18:55 7号彩虹 阅读(25) 评论(0) 推荐(0)
 
变量,常量,作用域
摘要: public class Changliang { //前两为修饰符,不存在先后顺序 static final double PI=3.14; public static void main(String[] args) { System.out.println(PI); } } 阅读全文
posted @ 2022-07-20 18:00 7号彩虹 阅读(27) 评论(0) 推荐(0)
 

2022年7月19日

类型转换
摘要: public class leixing { public static void main(String[] args) { int i =128; byte a = (byte) i;//内存溢出! //强制转换 (类型)变量名 高--低 int b = 129; double c = b; S 阅读全文
posted @ 2022-07-19 18:49 7号彩虹 阅读(20) 评论(0) 推荐(0)
 

2022年7月18日

数据类型扩展
摘要: public class shuju { public static void main(String[] args) { //整数扩展 进制: 二进制0b 八进制0 十进制 十六进制0x int i =10; int i1 =010;//八进制 int i2 =0x10;//十六进制 System 阅读全文
posted @ 2022-07-18 20:46 7号彩虹 阅读(29) 评论(0) 推荐(0)
 

2022年7月17日

基本数据类型
摘要: 代码示例 public class JAVA { public static void main(String[] args) { //整数 byte num1 = 110; Short NUM2 = 120; int num3 = 130;//(最常用) long num4 = 140000;// 阅读全文
posted @ 2022-07-17 12:31 7号彩虹 阅读(20) 评论(0) 推荐(0)
 

2022年7月16日

注释、关键字、标识符
摘要: 注释 1.单行注释://+注释内容 2.多行注释:/* 注释内容*/ 3.文档注释;/** 注释内容*/ 关键字(注意:不能用来命名!) 标识符注意点 String name(标识符) 阅读全文
posted @ 2022-07-16 11:02 7号彩虹 阅读(27) 评论(0) 推荐(0)
 

2022年7月13日

Hello word
摘要: 1.新建文件夹 2.更改文件名 !后缀名为.java !注意点:系统可能没有显示后缀名 3.编写代码 public class Hello{ public static void main(String[] args){ System.out.print("Hello,word!"); } } 4. 阅读全文
posted @ 2022-07-13 12:38 7号彩虹 阅读(124) 评论(0) 推荐(0)
 
上一页 1 2 3 4 5 6