摘要: package operator;public class Demo01 { public static void main(String[] args) { //算术运算符 //ctrl+D 复制当前行到下一行 int a = 10; int b = 20; int c = 25; int d = 阅读全文
posted @ 2021-08-19 09:02 小风扇呜呜呜 阅读(24) 评论(0) 推荐(0)
摘要: public class Demon10 { //类变量 static static double salary = 2500; //属性:变量 //实例变量:从属于对象;如果不自行初始化,则输出这个类型的默认值0、0.0 //布尔值默认false //除了基本类型,其余的默认值都是full; St 阅读全文
posted @ 2021-08-18 21:41 小风扇呜呜呜 阅读(12) 评论(0) 推荐(0)
摘要: public class Demon09 {//定义常量static修饰符,不分先后顺序。 static final double Pi = 3.14; public static void main(String[] args) { System.out.println(Pi); }}输出: 3. 阅读全文
posted @ 2021-08-18 21:28 小风扇呜呜呜 阅读(40) 评论(0) 推荐(0)
摘要: public class Demo06 { public static void main(String[] args) { int i = 128; double b = i; //强制转换: (类型)变量名 高——底 //自动转换: 底——高 System.out.println(i); Sys 阅读全文
posted @ 2021-08-18 20:40 小风扇呜呜呜 阅读(33) 评论(0) 推荐(0)
摘要: public class BeerSong { public static void main(String[] args) { int beerNum = 99; String word = "bottles"; while (beerNum > 0) { if (beerNum == 1) { 阅读全文
posted @ 2021-08-18 16:36 小风扇呜呜呜 阅读(65) 评论(0) 推荐(0)
摘要: public class IfTest2 { public static void main(String[] args) { int x = 2; if (x == 3) { System.out.println("x must be 3"); } else { System.out.printl 阅读全文
posted @ 2021-08-18 15:56 小风扇呜呜呜 阅读(17) 评论(0) 推荐(0)
摘要: public class Loopy { public static void main(String[] args) { int x = 1; System.out.println("Before the Loop"); while (x<4) { System.out.println("In t 阅读全文
posted @ 2021-08-18 15:43 小风扇呜呜呜 阅读(39) 评论(0) 推荐(0)
摘要: public class HelloWorld { public static void main(String[] args) { int i = 10; int i2 = 020; int i3 = 0x12; int i4 = 0b111; System.out.println(i); Sys 阅读全文
posted @ 2021-08-17 16:00 小风扇呜呜呜 阅读(23) 评论(0) 推荐(0)
摘要: Hello World 1.编写代码 public class Hello{ public static void main(String[] args){ System.out.print("Hello,WQY"); } } 2.编译命令 javac+ java文件,会生成一个class文件 3. 阅读全文
posted @ 2021-08-15 10:11 小风扇呜呜呜 阅读(13) 评论(0) 推荐(0)
摘要: Microsoft Windows [版本 10.0.19042.1110](c) Microsoft Corporation。保留所有权利。 E:\桌面\研究生\假期学习\code>javac Hello.java'javac' 不是内部或外部命令,也不是可运行的程序或批处理文件。 E:\桌面\研 阅读全文
posted @ 2021-08-13 21:10 小风扇呜呜呜 阅读(33) 评论(0) 推荐(0)