Operators are such symbols that perform some
operations on one or more operands. Operators are used to
manipulate primitive data types. Once we declare and initialize the variables, we can
use operators to perform certain tasks like assigning a value, adding the
Java operators can be classified into different categories as shown:
In Java, an expression is like a statement without a
terminator ( i.e. statement = expression + ; ). It
is made up of variables, operators, and method invocations, which are
defined in accordance to the syntax of the language. The overall coding in a Java
program is achieved through the expressions ( which may have single or multiple operations)
. In all cases, a single evaluated value is obtained irrespective of composition
of the multiple expressions. The evaluation of an expressions is determined by
the order of precedence of the operators.
Few of the examples of expressions are:
int number = 2
arr = 10
int abc = a + (++b)* ((c / a)*
you") // a compound expression
After executing an expression, a value
is returned by an expression, it's data type depends on the elements used in
Java also allows you to build the compound expression.
There are three purposes for defining an expression :
We have 1000s of tutorials on our website. Search Tutorials tutorials on our website.
Posted on: December 18, 2008 If you enjoyed this post then why not add us on Google+? Add us to your Circles