Jun 17, 2024
.dmg
file from Oracle's website.sendEmail()
, convertWeight()
).public static void main(String[] args)
).Main
).public class Main
).int age = 30;
(must initialize before use).Date
, Point
); use new
keyword.final
keyword (e.g., final float PI = 3.14F;
).Integer.parseInt()
).+
, -
, *
, /
, %
.+=
, -=
, *=
, /=
, %=
.++
) and decrement (--
) operators.Math.round()
, Math.ceil()
, Math.floor()
, Math.max()
, Math.min()
, Math.random()
.NumberFormat
class for currency and percent formatting.String message = "Hello World";
.length()
, indexOf()
, replace()
, toLowerCase()
, toUpperCase()
, trim()
, startsWith()
, endsWith()
.\n
, \t
, \"
, \\
.Scanner scanner = new Scanner(System.in);
.nextInt()
, nextFloat()
, nextDouble()
, nextLine()
.int[] numbers = {1, 2, 3, 4, 5};
.int[][] matrix = {{1, 2, 3}, {4, 5, 6}};
.Arrays
class (e.g., Arrays.toString(array)
, Arrays.sort(array)
).==
, !=
, >
, >=
, <
, <=
.&&
(and), ||
(or), !
(not).if
, else if
, else
.switch(variable) { case value: // code; break; default: // code; }
.condition ? trueExpression : falseExpression
.for (initialization; condition; update) {}
.while (condition) {}
.do {} while (condition);
(executes at least once).for (dataType item : collection) {}
.break;
(terminates loop), continue;
(skips to next iteration).