ptg7068951
76 HOUR 6:Using Strings to Communicate
Workshop
The followingquestions test your knowledge of the care and feeding of a string.
Quiz
- My friend concatenates. Should I report him to the authorities?
A. No. It’s only illegal during the winter months.
B. Ye s ,but not until I sell the story to TMZ.com first.
C. No. All he’s doing is pasting two strings together in a program. - Why is the word Stringcapitalized,whereas intand others are not?
A. Stringis a full word,but intain’t.
B. Like all objects that are a standard part of Java,Stringhas a
capitalized name.
C. Poor quality control at Oracle. - Which of the following characters puts a single quote in a string?
A.
B. \’
C. ‘
Answers
- C.Concatenation is just another word for pasting,joining,melding,or oth-
erwise connecting two strings together. It uses the +and+=operators. - B.The types of objects available in Java are all capitalized,which is the
main reason variable names have a lowercase first letter. It makes it
harder to mistake them for objects. - B.The single backslash is what begins one of the special characters
that can be inserted into strings.