मराठी

Explain the Various Types of Bitwise Operators in Java.

Advertisements

प्रश्न

Explain the Various Types of Bitwise Operators in Java.

स्पष्ट करा
Advertisements

उत्तर

  1. Bitwise AND Operator (&): This operator compares the corresponding bits of two operands and returns 1 only when both bits are 1. Otherwise, it returns 0.
  2. Bitwise OR Operator (|): This operator compares the corresponding bits of two operands and returns 1 if at least one of the bits is 1. Otherwise, it returns 0.
  3. Bitwise XOR Operator (^): This operator compares the corresponding bits of two operands and returns 1 when the bits are different. If both bits are the same, it returns 0.
  4. Bitwise Complement Operator (~): This is a unary operator that reverses all the bits of an integer value. It changes 0 to 1 and 1 to 0.
  5. Left Shift Operator (<<): This operator shifts the bits of a number to the left by the specified number of positions. Zeros are inserted into the vacant positions on the right.
  6. Signed Right Shift Operator (>>): This operator shifts the bits of a number to the right by the specified number of positions while preserving its sign.
  7. Unsigned Right Shift Operator (>>>): This operator shifts the bits of a number to the right by the specified number of positions and fills the vacant positions on the left with zeros.
shaalaa.com
  या प्रश्नात किंवा उत्तरात काही त्रुटी आहे का?
पाठ 6: Variables and Expressions - EXERCISE [पृष्ठ १३१]

APPEARS IN

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

Englishहिंदीमराठी


      Forgot password?
Use app×