Aug 22, 2024
System.out.print()
or System.out.println()
to display text.println
adds a new line, while print
does not.
for new lines) can be used within strings.//
/* comment */
sysout
for print statements) to speed up coding.Ctrl + Minus/Plus
to zoom in/out in the IDE.int x = 123;
System.out.println(x);
import java.util.Scanner;
Scanner scanner = new Scanner(System.in);
String name = scanner.nextLine();
+
, -
, *
, /
, %
(modulus).JOptionPane
for dialog boxes.String name = JOptionPane.showInputDialog("Enter your name:");
max
, min
, abs
, sqrt
, rounding methods, etc.double z = Math.sqrt(x * x + y * y);
Random
class to generate random numbers.import java.util.Random;
int roll = random.nextInt(6) + 1;