// splitting a string literal over more than one line String s = "abcdefghijklmnopqrst" + "uvwxyz";There is no speed penalty for the + concatenation. It is done at compile time. String literals can be used anywhere you might use a String reference. e.g. "abc".charAt(1) is legal. For problematic/awkward/reserved/quotable characters like embedded ", see escape sequences below.
![]() |
and suggestions to improve this page to Roedy Green : | ||
| Canadian Mind Products | |||
| mindprod.com IP:[65.110.21.43] | |||
| Your face IP:[38.103.63.16] | The information on this page is for non-military use only. | ||
| You are visitor number 30,153. | Military use includes use by defence contractors. | ||
| You can get a fresh copy of this page from: | or possibly from your local J: drive (Java virtual drive/Mindprod website mirror) | ||
| http://mindprod.com/jgloss/literal.html | J:\mindprod\jgloss\literal.html | ||