Other kinds of expression
An expression can evaluate to any of the types
Java supports — i.e.:
- char
- boolean
- numeric (int, byte, short, long, float, double)
- array
- object
When a variable identifier appears in a
program it evaluates to a value of its type (primitive, array or object). Likewise, a
message sent to an object, whose corresponding method returns a value will evaluate to the
type of the value of the reply (for example, the method Math.random() returns a reply
value of type double).
Each time you assign a value to a variable,
perform a test for a selection or iteration statement, pass arguments with messages, and
write statements to process the replies from methods you will be dealing with expressions.
They are an invaluable feature of the Java programming language.
Back
to top
. 
RITSEC - Global Campus
Copyright ?1999 RITSEC- Middlesex University. All rights reserved.
webmaster@globalcampus.com.eg
|