The JavaTM Tutorial
Previous Page Lesson Contents Next Page Start of Tutorial > Start of Trail > Start of Lesson Search
Feedback Form

Trail: Learning the Java Language
Lesson: Language Basics

Other Operators

The Java programming language also supports the operators in the next table.

Other Operators
Operator Use Description
?: op1 ? op2 : op3 If op1 is true, returns op2; otherwise, returns op3
[] See Creating and Using Arrays (in the Learning the Java Language trail) Used to declare arrays, to create arrays, and to access array elements
. See Using Objects (in the Learning the Java Language trail) Used to form long names
(params) See Defining Methods (in the Learning the Java Language trail) Delimits a comma-separated list of parameters
(type) (type) op Casts (converts) op to the specified type; an exception is thrown if the type of op is incompatible with type
new See Using Objects (in the Learning the Java Language trail) and Creating and Using Arrays (in the Learning the Java Language trail) Creates a new object or array
instanceof op1 instanceof op2 Returns true if op1 is an instance of op2


Previous Page Lesson Contents Next Page Start of Tutorial > Start of Trail > Start of Lesson Search
Feedback Form

Copyright 1995-2005 Sun Microsystems, Inc. All rights reserved.