A+ Computer Science Java Syntax, Output, and Variables Test Review

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

1/39

flashcard set

Earn XP

Description and Tags

Flashcard deck covering Java syntax, print output, variable declarations, data types, ASCII values, and formatting rules based on the A+ Computer Science review test.

Last updated 11:26 PM on 9/1/26
Name
Mastery
Learn
Test
Matching
Spaced
Call with Kai
Chat

No analytics yet

Send a link to your students to track their progress

40 Terms

1
New cards

What is the output of the statement System.out.print("abc");?

abc

2
New cards

What is the output of the statement System.out.print("a\tc");?

a c

3
New cards

What is the output of the code block public static void main( String args[ ] ) { }?

no output

4
New cards

What is the output of the statement System.out.print("ab\ab");?

ab\ab

5
New cards

Which of the following is not a legal reserved word for a Java data type: double, integer, float, char, or byte?

integer

6
New cards

What is the output of String s = "abcdef"; System.out.println(s);?

abcdef

7
New cards

In Java, every program statement ends with what symbol?

;

8
New cards

Which of the following is a valid identifier in Java: 123java, main, java1234, or {abce?

java1234

9
New cards

Which of the following can be used to comment code in Java?

//

10
New cards

Which of the following is a 32-bit data type in Java: char, long, double, or int?

int

11
New cards

What is the output of System.out.println(3 + " " + 3);?

3 3

12
New cards

What is the output of System.out.println(3 + 6);?

9

13
New cards

What is the output of System.out.println("\"9");?

"9

14
New cards

Which of the following lines correctly defines a String variable in Java?

String s = "cdef";

15
New cards

Which of the following lines correctly defines an int variable in Java?

int i = 234;

16
New cards

Which of the following lines correctly defines a double variable in Java?

double d = 234.1;

17
New cards

Which of the following lines correctly defines a char variable in Java?

char c = 'a';

18
New cards

Which of the following data types uses the most memory: double, int, float, char, or byte?

double

19
New cards

Which of the following data types uses the least memory: int, double, char, float, or long?

char

20
New cards

In Java programming, you should never put a semicolon before an open what?

brace

21
New cards

Which method would move the cursor down to the next line when printing in Java?

println()

22
New cards

Every method in Java must have an open and close what?

brace

23
New cards

Which sequence is the newline character in Java?

\n

24
New cards

Which sequence is the tab character in Java?

\t

25
New cards

Which sequence would print one backslash on the screen if used in a print() or println() method?

\

26
New cards

What is the output of int aNum = 9; double bNum = aNum; System.out.println(bNum);?

9.0

27
New cards

What is the output of double cNum = 9.0; int dNum = cNum; System.out.println(dNum);?

none - error

28
New cards

What is the ASCII value of 'b'?

9898

29
New cards

What is the ASCII value of 'B'?

6666

30
New cards

What is the output of char c = 65; System.out.println(c);?

A

31
New cards

Which of the following is a 16-bit unsigned data type in Java: byte, short, char, long, or float?

char

32
New cards

Which of the following is an 8-bit data type in Java: byte, short, char, long, or float?

byte

33
New cards

Which of the following is a signed 16-bit data type in Java: byte, short, char, long, or float?

short

34
New cards

What is the output of double eNum = 'A'; System.out.println(eNum);?

65.0

35
New cards

What is the output of int fNum = 'A'; System.out.println(fNum);?

65

36
New cards

What is the output of int wNum = 'a' + 2; System.out.println(wNum);?

99

37
New cards

What is the output of float gNum = 9.2; System.out.println(gNum);?

error

38
New cards

What is the output of double hNum = 9.2f; System.out.println(hNum);?

9.2

39
New cards

Which data type could fill in ' checkIt = 87394;'?

int

40
New cards

Which data type could fill in ' whyNot = 34.53;'?

double