Java Programming Concepts Review

0.0(0)
studied byStudied by 0 people
0.0(0)
full-widthCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/49

flashcard set

Earn XP

Description and Tags

Flashcards covering key concepts from Java programming, including primitive types, boolean expressions, and coding problems.

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced
Call with Kai

No study sessions yet.

50 Terms

1
New cards

Default value of uninitialized int in Java

0

2
New cards

Primitive type for true/false values

Boolean

3
New cards

Declaration for a String variable named 'name'

String name;

4
New cards

Primitive type for decimal numbers

double

5
New cards

Result of 10 / 4 in integer division

2

6
New cards

Declaration for a boolean variable named 'isActive'

boolean isActive;

7
New cards

What happens when an int is divided by a double?

It auto casts to double.

8
New cards

Default value of a boolean in Java

false

9
New cards

Primitive types on the AP Test

int, double, boolean

10
New cards

Result of 3.0 / 2 in Java

1.5

11
New cards

Result of true || false

True

12
New cards

Result of true && false

False

13
New cards

Evaluation of !(x == 5) when x = 5

False

14
New cards

Boolean expression for x not between 10 and 20 inclusive

!(x >= 10 && x <= 20)

15
New cards

Result of !(a > 5 || b < 3) when a = 6 and b = 2

False

16
New cards

Simplification of !(x && y) using De Morgan's Law

!x || !y

17
New cards

Simplification of !(a || b) using De Morgan's Law

!a && !b

18
New cards

Simplification of !(x > 5 && y < 10) using De Morgan's Law

!x || y >= 10

19
New cards

Output of System.out.println(a / 2 * 2) when a = 7

6

20
New cards

Issue with 'double value = 3.7; int num = value;'

Cannot assign a double to an int without explicit casting.

21
New cards

Code to declare int variable 8, cast to double and print

int num = 8; double result = (double) num; System.out.println(result);

22
New cards

Boolean expression for x divisible by 3 but not by 5

x % 3 == 0 && x % 5 != 0

23
New cards

Output when x = 5 and x > 3 && x < 10

Orange

24
New cards

Result of ! (10 > 5 || 2 < 3)

False

25
New cards

Result when x = 8, y = 6 for x == 8 || y != 5 && y == 6

True

26
New cards

Default value of uninitialized int variable in Java

0

27
New cards

Primitive type for true/false values

Boolean

28
New cards

Valid declaration for a String variable

String name;

29
New cards

Primitive type for storing decimal numbers

double

30
New cards

Result of 10 / 4 in integer division

2

31
New cards

Declaration of a boolean variable

boolean isActive;

32
New cards

Result when dividing an int by a double

It auto casts to double.

33
New cards

Default value of a boolean in Java

false

34
New cards

Primitive types on the AP Test

int, double, boolean

35
New cards

Result of 3.0 / 2 in Java

1.5

36
New cards

Result of true || false

True

37
New cards

Result of true && false

False

38
New cards

Evaluation of !(x == 5) when x = 5

False

39
New cards

Boolean expression that checks if x is not between 10 and 20 inclusive

!(x >= 10 && x <= 20)

40
New cards

Result of !(a > 5 || b < 3) when a = 6 and b = 2

False

41
New cards

Simplified expression of !(x && y) using De Morgan's Law

!x || !y

42
New cards

Simplified expression of !(a || b) using De Morgan's Law

!a && !b

43
New cards

Simplified expression of !(x > 5 && y < 10) using De Morgan's Law

!x || y >= 10

44
New cards

Output of code int a = 7; System.out.println(a / 2 * 2);

6

45
New cards

Problem in code double value = 3.7; int num = value;

Cannot assign a double to an int without explicit casting.

46
New cards

Code to declare an int variable with value 8 and cast to double

int num = 8; double result = (double) num; System.out.println(result);

47
New cards

Boolean expression to check if x is divisible by 3 but not by 5

x % 3 == 0 && x % 5 != 0

48
New cards

Output of code int x = 5; if (x > 3 && x < 10)…

Orange

49
New cards

Output of code boolean result = ! (10 > 5 || 2 < 3); System.out.println(result);

false

50
New cards

Output of expression x == 8 || y != 5 && y == 6 when x = 8 and y = 6

true