CODECADEMY QUIZ Flashcards
In Java, we _____ objects that we need to persist, store in a file, or send over a network
Serialize
What two keywords will automatically prevent a field from not being serialized?
static and transient
True or False: The output file when using FileOutputStream and ObjectOutputStream results in a human-readable file, similar to a poorly formatted JSON file.
False
Converting an object from its bytecode format back to its Java object format is called:
Deserialization
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. Byte
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.) javac HelloWorld.java
Which of the following statement prints output to a new line?
A. System.out.print()
B. System.out.println()
C. System.out.printf()
B.) System.out.println()
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!”);
C.)
System.out.print(“I love “);
System.out.print(“pizza!”);
Fill in the blanks to complete the following statement.
Java programs must first be compiled into
_________
, and then can be run using the
______
prompt
Java Byte Code
and
terminal/cmd
______ refer to a group of exceptions that a program may
encounter related to input or ______ of a java program.
IOExceptions
and
OUTPUT
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.
d) A class that is attempting to be loaded cannot be found.
True or false: The class FileReader is used to output data from a program into a file on your computer.
FALSE
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.
input
and
checked