摘要: Break: the "break" stops the loop for (int i = 0; i < 10; i++) { if (i == 1) { break; } System.out.println(i); } // Outputs 0 Continue: The continue s 阅读全文
posted @ 2022-11-25 02:26 小白冲冲 阅读(11) 评论(0) 推荐(0) 编辑
摘要: int i = 0; do { System.out.println(i); i++; } while (i < 5); // Outputs 0 1 2 3 4 At least it will invoke 1 time the code inside of "do" int i = 0; do 阅读全文
posted @ 2022-11-24 03:57 小白冲冲 阅读(16) 评论(0) 推荐(0) 编辑
摘要: Instead of writing many if..else statements, you can use the switch statement. int day = 4; switch (day) { // every case will be a posibility of "day" 阅读全文
posted @ 2022-11-24 03:39 小白冲冲 阅读(82) 评论(0) 推荐(0) 编辑
摘要: Math.max(5, 10); // Outputs 10 Math.min(5, 10); // Outputs 5 Math.sqrt(64); // Outputs 8.0 Math.abs(-4.7); // Outputs 4.7 Math.random(); // returns a 阅读全文
posted @ 2022-11-24 03:28 小白冲冲 阅读(16) 评论(0) 推荐(0) 编辑
摘要: String Methods: String txt = "Hello World"; System.out.println(txt.toUpperCase()); // Outputs "HELLO WORLD" System.out.println(txt.toLowerCase()); // 阅读全文
posted @ 2022-11-24 03:17 小白冲冲 阅读(29) 评论(0) 推荐(0) 编辑
摘要: In Java, there are two types of casting: Widening Casting (automatically) - converting a smaller type to a larger type sizebyte -> short -> char -> in 阅读全文
posted @ 2022-11-24 02:38 小白冲冲 阅读(9) 评论(0) 推荐(0) 编辑
摘要: Primitive types are predefined (already defined) in Java. Non-primitive types are created by the programmer and is not defined by Java (except for Str 阅读全文
posted @ 2022-11-24 02:28 小白冲冲 阅读(58) 评论(0) 推荐(0) 编辑
摘要: Example Instead of writing: int x = 5; int y = 6; int z = 50; System.out.println(x + y + z); You can simply write: int x = 5, y = 6, z = 50; System.ou 阅读全文
posted @ 2022-11-24 02:16 小白冲冲 阅读(11) 评论(0) 推荐(0) 编辑
摘要: @javax.validation.constraints.AssertTrue public class MyModel { private String value1; private String value2; @AssertTrue(message = "Values are invali 阅读全文
posted @ 2022-08-12 18:40 小白冲冲 阅读(1414) 评论(0) 推荐(0) 编辑
摘要: 方法1.你点击一下你idea界面最左下角的那个小框,maven应该从里面找到 方法2.点击菜单栏View->Tool Windows->Maven projects 方法3.点击菜单栏Help->Find Action(Ctrl+Shift+A),输入Maven projects,选中要打开的项目。 阅读全文
posted @ 2022-08-12 04:00 小白冲冲 阅读(954) 评论(0) 推荐(0) 编辑