COP 3330 FINAL Exam Questions
and Answers 100% Pass
True or False
When String objects are compared using ==, the result is true if the strings contain
the same values. - CORRECT ANSWER-False. String objects are compared using
the operator == to compare if they are the same object in memory.
True or False
A string can be modified after it's created. - CORRECT ANSWER-False. string
objects are immutable and cannot be modified after they're created. Stringbuilder
objects can be modified after they're created.
Compare the string in s1 to the string in s2 for equality of contents. - CORRECT
ANSWER-s1.equals(s2)
Append the string s2 to the string s1, using +=. - CORRECT ANSWER-s1 += s2;
Determine the length of the string in s1. - CORRECT ANSWER-s1.length()
True or False
, You must explicitly create the stream objects System.in, System.out, and
System.err. - CORRECT ANSWER-False. These 3 streams are created for you
when a java app begins execution
When reading data from a file using class Scanner, if you wish to read data in the
file multiple times, the file must be closed and reopened to read from the
beginning of the file - CORRECT ANSWER-True
T/F
Files static method "exists" receives a Path and determines whether it exists (either
as a file or as a directory) on disk. - CORRECT ANSWER-True
Binary files are human readable in a text editor. - CORRECT ANSWER-False.
Text files are human Readable, Binary files are only readable if they appear in
ASCII text
An absolute path contains all the directories, starting with the root directory, that
lead up to a specific file or directory. - CORRECT ANSWER-True
Class "Formatter" contains method printf, which enables formatted data to be
output to the screen or to a file. - CORRECT ANSWER-False. Formatter contains
COPYRIGHT ©️ 2025 ALL RIGHTS RESERVED
and Answers 100% Pass
True or False
When String objects are compared using ==, the result is true if the strings contain
the same values. - CORRECT ANSWER-False. String objects are compared using
the operator == to compare if they are the same object in memory.
True or False
A string can be modified after it's created. - CORRECT ANSWER-False. string
objects are immutable and cannot be modified after they're created. Stringbuilder
objects can be modified after they're created.
Compare the string in s1 to the string in s2 for equality of contents. - CORRECT
ANSWER-s1.equals(s2)
Append the string s2 to the string s1, using +=. - CORRECT ANSWER-s1 += s2;
Determine the length of the string in s1. - CORRECT ANSWER-s1.length()
True or False
, You must explicitly create the stream objects System.in, System.out, and
System.err. - CORRECT ANSWER-False. These 3 streams are created for you
when a java app begins execution
When reading data from a file using class Scanner, if you wish to read data in the
file multiple times, the file must be closed and reopened to read from the
beginning of the file - CORRECT ANSWER-True
T/F
Files static method "exists" receives a Path and determines whether it exists (either
as a file or as a directory) on disk. - CORRECT ANSWER-True
Binary files are human readable in a text editor. - CORRECT ANSWER-False.
Text files are human Readable, Binary files are only readable if they appear in
ASCII text
An absolute path contains all the directories, starting with the root directory, that
lead up to a specific file or directory. - CORRECT ANSWER-True
Class "Formatter" contains method printf, which enables formatted data to be
output to the screen or to a file. - CORRECT ANSWER-False. Formatter contains
COPYRIGHT ©️ 2025 ALL RIGHTS RESERVED