摘要: 循环结构 for循环 基本格式: { int x = 1; 变量初始化, x<1; 条件 x++/++x 增量表达式, } 九九乘法表 ···java public class JiuJiuChengFaBiao { public static void main(String[] args) { 阅读全文
posted @ 2024-03-08 16:33 努力做最好的自己 阅读(3) 评论(0) 推荐(0) 编辑
摘要: Hello World 随便新建一个文件夹,存放代码 新建java文件 文件后缀.java Hello.java [注意点]系统可能没有显示文件后缀名,需要手动打开 编写代码 public class Hello{ public static void main(String[] args){ Sy 阅读全文
posted @ 2024-03-08 16:28 努力做最好的自己 阅读(6) 评论(0) 推荐(0) 编辑
摘要: 选择结构 if if-else-else switch if ···java public class sda { public static void main(String[] args) { int x=1; int y; if(x>0){ y=x; }else{ y=-x; } System 阅读全文
posted @ 2024-03-08 16:28 努力做最好的自己 阅读(1) 评论(0) 推荐(0) 编辑
摘要: 一、JDK,JRE,JVM的区别 图例: JDK:java程序开发工具,包含JRE和开发工具。 JRE:是java运行时的环境,包含JVM的核心类库。(运行环境) JVM:虚拟机。 二、java是解释执行的高级编程语言 保证,先编译后解释。 三、java语法规则 (1)代码区分大小写 Scanner 阅读全文
posted @ 2024-03-08 14:41 努力做最好的自己 阅读(10) 评论(0) 推荐(0) 编辑
摘要: class Scratch { public static void main(String[] args) { int a =10; int b =20; a+=b; //a=a+b a-=b; //a=a-b System.out.println(a); System.out.println(" 阅读全文
posted @ 2024-02-15 02:06 努力做最好的自己 阅读(6) 评论(0) 推荐(0) 编辑
摘要: class Scratch { public static void main(String[] args) { //逻辑运算符 //与(and) 或(or) 非(取反) boolean a=true; boolean b=false; System.out.println("a&&b:"+(b&& 阅读全文
posted @ 2024-02-15 01:55 努力做最好的自己 阅读(76) 评论(0) 推荐(0) 编辑
摘要: class Scratch { public static void main(String[] args) { //二元运算符 //ctrl+D 复制到下一行 int a = 10; int b = 20; int c = 30; int d = 40; System.out.println(a+ 阅读全文
posted @ 2024-02-15 01:41 努力做最好的自己 阅读(20) 评论(0) 推荐(0) 编辑
摘要: class Scratch { public static void main(String[] args) { //int a,b,c //int a=1,b=2,c=3; 程序可读性 String name = "niedoalei"; char X='x'; double p1= 3.14; 阅读全文
posted @ 2024-02-15 01:15 努力做最好的自己 阅读(7) 评论(0) 推荐(0) 编辑
摘要: class Scratch { public static void main(String[] args) { int i =128; byte b =(byte)i; //内存溢出 //强制转换 (类型)变量名 高--低 //自动转换 低--高 System.out.println(i); Sy 阅读全文
posted @ 2024-02-14 00:10 努力做最好的自己 阅读(10) 评论(0) 推荐(0) 编辑
摘要: class Scratch { public static void main(String[] args) { //整数拓展: 进制 二进制0b 十进制 八进制0 十六进制0x int i = 10; int i2 =010; //八进制0 int i3 =0x10; //十六进制0x 0-9 A 阅读全文
posted @ 2024-02-13 23:52 努力做最好的自己 阅读(4) 评论(0) 推荐(0) 编辑
点击右上角即可分享
微信分享提示