हिंदी

Explain the Various Types of Operators in Java.

Advertisements

प्रश्न

Explain the Various Types of Operators in Java.

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

उत्तर

  1. Arithmetic Operators: These operators are used to perform mathematical operations such as addition, subtraction, multiplication, division and modulus.
    Examples: +, -, *, /, %.
  2. Relational Operators: These operators are used to compare two values or expressions. They return a Boolean result, either true or false. Examples: ==, !=, >, <, >=, <=.
  3. Logical Operators: These operators are used to combine or reverse Boolean expressions and conditions.
    Examples: && (AND), || (OR), ! (NOT).
  4. Assignment Operators: These operators are used to assign values to variables and perform operations while assigning values.
    Examples: =, +=, -=, *=, /=, %=.
  5. Unary Operators: These operators perform operations on a single operand. They are used to increase, decrease or change the sign of a value.
    Examples: ++, --, +, -, !.
  6. Bitwise Operators: These operators are used to perform operations on the individual bits of integer values.
    Examples: &, |, ^, ~.
  7. Shift Operators: These operators are used to shift the bits of an integer value to the left or right.
    Examples: <<, >>, >>>.
  8. Conditional (Ternary) Operator: This operator is used to select one of two values based on a condition. It uses the symbols ? and :.
  9. instanceof Operator: This operator is used to check whether an object is an instance of a particular class or interface. It returns a Boolean value, either true or false.
shaalaa.com
  क्या इस प्रश्न या उत्तर में कोई त्रुटि है?
अध्याय 6: Variables and Expressions - EXERCISE [पृष्ठ १३१]

APPEARS IN

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

Englishहिंदीमराठी


      Forgot password?
Use app×