Jul 11, 2024
int x;
).x = 123;
).int x = 123;
).System.out.println
.import java.util.Scanner;
Scanner scanner = new Scanner(System.in);
nextLine()
: for stringsnextInt()
: for integersnextDouble()
: for floating-point numbersnextLine()
method.++
for incrementing by 1--
for decrementing by 1double result = (double) x / y;
)javax.swing.JOptionPane
.showInputDialog
) and message dialogs (showMessageDialog
).max(x, y)
: returns the larger of two numbers.min(x, y)
: returns the smaller of two numbers.abs(x)
: returns the absolute value.sqrt(x)
: returns the square root.round(x)
, ceil(x)
, floor(x)
: different rounding methods.sqrt
function.sysout + Ctrl + Spacebar
for System.out.println
).