摘要:
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 阅读全文
摘要:
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 阅读全文
摘要:
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" 阅读全文
摘要:
In Java, there are two types of casting: Widening Casting (automatically) - converting a smaller type to a larger type sizebyte -> short -> char -> in 阅读全文
摘要:
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 阅读全文
摘要:
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 阅读全文