Big Java: 2 Flashcards
how to make it so that the value of a variable is never changeable?
in the declaration, precede the type with the word “final”
the three different types of delimiters (allow comments)
/** this program does etc */ /* this part does */ //this delimeter only end till end of this line
if we want an exact quotient, make sure that when dividing, at least one of the numbers is
a double
when two integers are divided…
the result is rounded down (the remainder is discarded)
how to compute x^n
Math.pow(x, n)
how to round to the closest integer to x
Math.round(x)
how to take the absolute value of x
Math.abs(x)
how to take the larger or smaller value from x and y
Math.max(x, y)
Math.min(x, y)
how to display a variable with two places after the decimal point
System.out.printf( “%.2f”, variablenamehere );