answersLogoWhite

0


Best Answer

* arithmetic expressions are evaluated from left to right using the rules of precedence..

* when parentheses are used,the expressions within parentheses assume highest priority...

* if parentheses are nested, the evaluation begins with the inner most parentheses...

* the associativity rules are applied when 2 or more operators of same precedence level appear in a sub expression

User Avatar

Wiki User

13y ago
This answer is:
User Avatar
More answers
User Avatar

Wiki User

11y ago

For example, a numeric expression is anything that can be evaluated to a number:

  • Numeric constant (such as 5),
  • Variables that have a numeric value, such as x,
  • A functions that returns a number, such as sin(5.0),
  • Any calculation involving numbers, variables, and functions, that makes sense and results in the number.

The above examples are for numeric expressions; similarly, you can have (for example) String expressions, which is anything that can be "calculated" or "evaluated", and results in a String.

This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: What are the rules for the expression evaluation in Java?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Continue Learning about Engineering

Define an expression that evaluates to true when i equals j?

In Java, or C, the expression is simply:i == jIf the two are equal, this expression will evaluate to true; if not, it will evaluate to false.In Java, or C, the expression is simply:i == jIf the two are equal, this expression will evaluate to true; if not, it will evaluate to false.In Java, or C, the expression is simply:i == jIf the two are equal, this expression will evaluate to true; if not, it will evaluate to false.In Java, or C, the expression is simply:i == jIf the two are equal, this expression will evaluate to true; if not, it will evaluate to false.


What is syntax errors in java?

Runtime errors in Java means that there is some code error existing in your computer and it is impossible for you to deal with it by yourself unless you are the you're the applet's designer and change the code. Most of the time, runtime errors in Java will appear error message just like: "Java(TM) Plug-in Fatal Error Several Java Virtual Machines running in the same process caused an error." "Java(TM)Plug-in Fatal ERror the Java Runtime Environment cannot be loaded."


What does the modulus operator in Java do?

It is an binary arithmetic operator which returns the remainder of division operation. It can used in both floating-point values and integer values. opLeft % opRight where, opLeft is the left operand and opRight is the right operand. This expression is equivalent to the expression opLeft - ((int) (opLeft / opRight) * opRight)


Why people generally use oracle as backend of java projects?

there are certain rules to make up a relational data base management system, oracle follows it and so its an rdbms


What is the difference between Java 1.6 and Java 1.7?

Java 1.7 supports the features of 1.6 but introduces some new conventions:- Java 7 allows use of String object in the expression of a switch statement.- Auto-closing of resources (also known as try-with-resources)- Allow catching of multiple Exceptions- Allows underscores in Numeric Literal for readability (e.g. 1_234_567_890_123_456L)- Substitute the parameterized type of the constructor with an empty set of type parameters ()For full list see Java Programming Language Enhancements.

Related questions

Define an expression that evaluates to true when i equals j?

In Java, or C, the expression is simply:i == jIf the two are equal, this expression will evaluate to true; if not, it will evaluate to false.In Java, or C, the expression is simply:i == jIf the two are equal, this expression will evaluate to true; if not, it will evaluate to false.In Java, or C, the expression is simply:i == jIf the two are equal, this expression will evaluate to true; if not, it will evaluate to false.In Java, or C, the expression is simply:i == jIf the two are equal, this expression will evaluate to true; if not, it will evaluate to false.


What is the Evaluation?

to draw a conclusion from exaiming; to compute an expression


Evaluate the numeric expression 34?

34 is the evaluation of 34


C code for evaluation of prefix expression?

a*b*c


What is one thing Whitman and Dickinson had in common?

They both changed the rules of poetry


What Java conditional expression correctly represents the mathematical expression 10 x 100?

There is no need for a conditional expression; just write it as 10 * 100.


What does Evaluation?

find a numerical expression or equivalent for (an equation, formula, or function).


What is an algebra expression you replace each variable with a number?

evaluation, evaluate.


What order of evaluation?

The order of evaluation refers to the sequence in which operators are executed in an expression. In most programming languages, parentheses are evaluated first, followed by exponentiation, multiplication and division, and finally addition and subtraction. It's important to understand the order of evaluation to predict how an expression will be computed.


Evaluate the expression -3?

As it stands (because the rest of the expression may be missing) the evaluation to the constant value of -3 will be the result.


What does do in java?

You never write "do" seperately in Java. The only situation I can think of when you have to write "do" is in the "do while" statement. This is the syntax: do { statement(s) } while (expression);


Real time applications of stack?

The Most Best real time application is that the EXPRESSION EVALUATION