Numbers

  • "no explicit distinction between integers and real" numbers though integers may be stored differently than floating point or real numbers.
  • Here are some literal numbers being assigned to a variable (not a complete sampling):
·         x = 8        //integer
·         x = .7343    //floating point
·         x = -4.3e3   //same as -4.3 × 103
·         x = 4.3e-3   //same as 4.3 × 10-3

Boolean Values

  • true or false are the two Boolean values
  • Examples when true or false values result from an expression (not a complete sampling):
·         10 < 11     //will be evaluated to result in the value true 
·         10 > 11     //will be evaluated to false

Strings

  • strings can be created by assigning a literal value to a variable or by creating a String object initialized with a literal string.
·         msg = "I there is no end to the details I have to remember?"
·         msg = new String("Is there is not end to the details I have to remember?")

null

  • null - "special key word denoting a null value"
x = null

0 comments:

Post a Comment

Flag Counter