Big Java: 2 Flashcards Preview

Intro to Java > Big Java: 2 > Flashcards

Flashcards in Big Java: 2 Deck (9)
Loading flashcards...
1

how to make it so that the value of a variable is never changeable?

in the declaration, precede the type with the word "final"

2

the three different types of delimiters (allow comments)

/** this program does etc */
/* this part does */
//this delimeter only end till end of this line

3

if we want an exact quotient, make sure that when dividing, at least one of the numbers is

a double

4

when two integers are divided...

the result is rounded down (the remainder is discarded)

5

how to compute x^n

Math.pow(x, n)

6

how to round to the closest integer to x

Math.round(x)

7

how to take the absolute value of x

Math.abs(x)

8

how to take the larger or smaller value from x and y

Math.max(x, y)
Math.min(x, y)

9

how to display a variable with two places after the decimal point

System.out.printf( "%.2f", variablenamehere );