हिंदी

Explain the various Expressions of Java.

Advertisements

प्रश्न

Explain the various Expressions of Java.

स्पष्ट कीजिए
Advertisements

उत्तर

  1. Arithmetic Expressions: These expressions are used to perform mathematical calculations such as addition, subtraction, multiplication, division and modulus.
    Example: a + b * c
  2. Relational Expressions: These expressions are used to compare two values or variables. They return a Boolean result, either true or false.
    Example: a > b
  3. Logical Expressions: These expressions are used to combine or reverse Boolean conditions using logical operators such as AND (&&), OR (||) and NOT (!).
    Example: (a > b) && (a > c)
  4. Assignment Expressions: These expressions are used to assign a value or the result of an expression to a variable using assignment operators.
    Example: a = b + 10
  5. Conditional Expressions: These expressions use the ternary operator (? :) to select one of two values depending on whether a condition is true or false.
    Example: max = (a > b) ? a : b
  6. Bitwise Expressions: These expressions are used to perform operations on the individual bits of integer values using bitwise operators.
    Example: a & b
shaalaa.com
  क्या इस प्रश्न या उत्तर में कोई त्रुटि है?
अध्याय 6: Variables and Expressions - EXERCISE [पृष्ठ १३१]

APPEARS IN

धीरज मेहरोत्रा Computer Science [English] Class 12
अध्याय 6 Variables and Expressions
EXERCISE | Q 20. | पृष्ठ १३१
Advertisements
Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×