The String Literal in Java : Complete Tutorial

A String literal is a sequence of characters used by Java programmers to populate String objects or display text to a user. The characters could be letters, numbers or symbols and are enclosed within two quotation marks. For example,
"I live at 22b Baker Street!"
is a String literal.
Although in your Java code you will be writing the text within the quotes, the Java compiler will interpreting the characters as Unicode code points.
Unicode is a standard that assigns all letters, numbers and symbols a unique numerical code. This means that every computer will display the same character for each numerical code. This means that if you know the number values you can actually write String literals using Unicode values:  more...

No comments:

Post a Comment