Forums Register Login

How To Declare and Include Special Characters..

+Pie Number of slices to send: Send
Can anyone help me how to declare special characters that are frequently used in a program such as ', ", `, (, )...also I want to put those characters inside the System.out.println()..but when I put them inside and enclosed it with quotation mark for example, I want to put the string "), inside the System.out.println()..when I do that I came up with an error..need for your responses..thanks!
+Pie Number of slices to send: Send
to put some characters into System.out.println() you have to escape them with a \

Example, if you want to print out:
He said, "Hello"

you would have
System.out.println("He said, \"Hello\"");
+Pie Number of slices to send: Send
Hi,
You can use escape characters to print that characters.
You can read all about that at Java Language Specification - Lexical Structure .

Hope this helps and correct me if I am wrong...

thanks
daniel
girl power ... turns out to be about a hundred watts. But they seriuosly don't like being connected to the grid. Tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 1905 times.
Similar Threads
Sting "\" in my code
Editing Special Character
WSAD specific directions for creating an Oracle Data Source
Character encoding: Foreign characters not displayed correctly in XML and JSP
HQL + LIKE + _
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 29, 2024 09:40:15.