Explain the following: An Expression of Java
Advertisements
प्रश्न
Explain the following:
An Expression of Java
स्पष्ट कीजिए
Advertisements
उत्तर
- An Expression in Java is a combination of variables, constants, operators and method calls that is evaluated to produce a single value.
- Expressions are used to perform calculations, compare values and evaluate conditions in a Java program.
Example:
int a = 10, b = 20;
int sum = a + b;
In the above example, a + b is an arithmetic expression that adds the values of a and b and produces the result 30, which is assigned to the variable sum.
shaalaa.com
क्या इस प्रश्न या उत्तर में कोई त्रुटि है?
