Owl Teach Yourself Java in 24 Hours, Fifth Edition
HOME / FEEDBACK / ORDER THE BOOK / OTHER BOOKS / PREVIOUS HOUR / NEXT HOUR / THANKS
ROGERS CADENHEAD

Hour 6: Using Strings to Communicate

Online Interactive Learning Lab

How to create the Credits application.

Hour 6 Quiz

Question 1. My friend concatenates. Should I report him to the authorities?

1.a. No. It's only illegal during the winter months

1.b. Yes, but not until I sell the story to TMZ.com first

1.c. No. All he's doing is pasting two strings together in a program

Concatenation is just another word for pasting, joining, melding, or otherwise connecting two strings together. It uses the + and += operators.

Question 2. Why is the word String capitalized, while int and others are not?

2.a. String is a full word, but int ain't

2.b. Like all objects in Java, String has a capitalized name

2.c. Poor quality control at Sun Microsystems

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.

Question 3. Which of the following characters puts a single quote in a string?

3.a. <quote>

3.b. \'

3.c. '

The single backslash is what begins one of the special characters that can be inserted into strings.

Notes and Corrections

  • None.

Source Files

Reader Questions

  • None.

Activities

   
HOME / FEEDBACK / ORDER THE BOOK / OTHER BOOKS / PREVIOUS HOUR / NEXT HOUR / THANKS

Search terms used to find this page: Java programming, teach yourself, 24 hours, how to, learn, Sams, Macmillan, Java2, JDK1.5, Java 1.5, JDK 1.5, SDK1.5, Java 2 SDK 1.5, SDK 1.5, Java 2 version 1.5, J2SE 1.5, J2SE 5, Java 2 Standard Edition 1.5, Java 2 Standard Edition 5, Java 2 SDK, Java SDK, Rogers Cadenhead, tutorial, hands-on, source code, code, javac, java, appletviewer, help, learning, applet, application, Java Plug-in, plugin, Swing, GUI, interface, Java2D, IO, Java Web Start, games, novice, beginner, neophyte, rookie

Valid HTML 4.01!

Valid CSS!