Literals
String literals are indicated with single quotes. For example:
JMSType = 'updateAck'
If you need to use a single quote in a string literal, you use two single quotes. For example:
JMSCorrelationID = 'Joe''s message'
Numeric literals are either integer values or floating-point values. Integer values follow the rules for Java integer literals. They are all numerals, with no decimal point, and can have a value in the same range as a Java long value. For example:
42, 149, -273
Floating-point literals follow the syntax of Java floating-point literals. They are all numerals with a decimal point:
3.14, 98.6, -273.0
or are in scientific notation:
31.4e-1, 6.022e23, 2.998e8
Literals can also be the Boolean values TRUE
or FALSE
.
Get Java Enterprise in a Nutshell, Third Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.