Quiz
The following questions will test your knowledge of the care and feeding of a string.
Questions
1: |
My friend concatenates. Should I report him to the authorities?
- No. It's only illegal during the winter months.
- Yes, but not until I sell the story to Jerry Springer first.
- No. All he's doing is pasting two strings together in a program.
|
2: |
Why is the word String capitalized, while int and others are not?
- String is a full word, but int ain't.
- Like all objects in Java, String has a capitalized name.
- Poor quality control at Oracle.
|
3: |
Which of the following characters will put a single quote in a string?
|
Answers
A1: |
c. Concatenation is just another word for pasting, joining, melding, or otherwise connecting two strings together. It uses the + and += operators.
|
A2: |
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.
|
A3: |
b. The single backslash is what begins one of the special characters that can be inserted into strings.
|
|