CODECADEMY QUIZ Flashcards

1
Q

In Java, we _____ objects that we need to persist, store in a file, or send over a network

A

Serialize

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What two keywords will automatically prevent a field from not being serialized?

A

static and transient

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

True or False: The output file when using FileOutputStream and ObjectOutputStream results in a human-readable file, similar to a poorly formatted JSON file.

A

False

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Converting an object from its bytecode format back to its Java object format is called:

A

Deserialization

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Which of the following data types is not used by FileReader and FileWriter to read and write to files?

A. Byte
B. String
C. Char

A

A. Byte

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Which of the following examples shows the correct command to compile a Java program?

A. javac HelloWorld.java
B. java HelloWorld
C. java HelloWorld.java
D. javac HelloWorld

A

A.) javac HelloWorld.java

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Which of the following statement prints output to a new line?
A. System.out.print()
B. System.out.println()
C. System.out.printf()

A

B.) System.out.println()

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Which of the following statements will print the following output?

I love pizza!

A.)
System.out.println(“I love”);
System.out.println(“pizza!”);

B.)
System.out.printf(“I love “, pizza);

C.)
System.out.print(“I love “);
System.out.print(“pizza!”);

A

C.)
System.out.print(“I love “);
System.out.print(“pizza!”);

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Fill in the blanks to complete the following statement.

Java programs must first be compiled into
_________
, and then can be run using the
______
prompt

A

Java Byte Code
and
terminal/cmd

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

______ refer to a group of exceptions that a program may
encounter related to input or ______ of a java program.

A

IOExceptions
and
OUTPUT

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Which of the following is NOT an example of an IOException?

a) Failed attempts at trying to access a file.
b) An input/output operation has been interrupted.
c) The file a program is attempting to access cannot be found.
d) A class that is attempting to be loaded cannot be found.

A

d) A class that is attempting to be loaded cannot be found.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

True or false: The class FileReader is used to output data from a program into a file on your computer.

A

FALSE

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Fill in the blanks to complete the following statement.

IOExceptions are exceptions that are related to
____________
and/or output in a program and can be classified as
_________
exceptions.

A

input
and
checked

How well did you know this?
1
Not at all
2
3
4
5
Perfectly