APCSA 1.1-1.6

0.0(0)
Studied by 1 person
call kaiCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/11

encourage image

There's no tags or description

Looks like no tags are added yet.

12 Terms

1
New cards

What are int, double, and boolean?

int = whole numbers, double = decimal numbers, boolean = true or false

2
New cards

What is the difference between "int x;" and "x = 5;"?

"int x;" creates the variable name/type. "x = 5;" puts the value inside it.

3
New cards

What does % (modulus) do?

It finds the remainder of division (like 5 % 2 = 1).

4
New cards

What is 7 / 2 in Java?

3 (Java cuts off the decimal for whole numbers).

5
New cards

How do you get 3.5 instead of 3 from 7 / 2?

Add a decimal to at least one number (like 7.0 / 2).

6
New cards

print() vs. println()?

print() stays on the same line. println() moves to a new line after printing.

7
New cards

How does "x = 2 + 3;" evaluate?

Java solves the right side first (5), then stores it in x.

8
New cards

What is the order of math operations in Java?

  1. Parentheses, 2. * / %, 3. + -
9
New cards

What does (int) 5.99 do?

It chops off the decimal completely, resulting in 5.

10
New cards

What happens if an int goes past its maximum possible limit?

Overflow (it wraps around to a negative number).

11
New cards

What do x++ and x += 3 mean?

x++ adds 1 to x. x += 3 adds 3 to x.

12
New cards