हिंदी

Explain the various shorthand notations in JAVA.

Advertisements

प्रश्न

Explain the various shorthand notations in JAVA.

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

उत्तर

  1. Addition Assignment (+=): This operator adds the specified value to the existing value of a variable and assigns the result to the same variable.
    Example: a += 5; is equivalent to a = a + 5;
  2. Subtraction Assignment (-=): This operator subtracts the specified value from a variable and assigns the result to the same variable.
    Example: a -= 5; is equivalent to a = a - 5;
  3. Multiplication Assignment (*=): This operator multiplies the existing value of a variable by the specified value and stores the result in the same variable.
    Example: a *= 5; is equivalent to a = a * 5;
  4. Division Assignment (/=): This operator divides the existing value of a variable by the specified value and assigns the result to the same variable.
    Example: a /= 5; is equivalent to a = a / 5;
  5. Modulus Assignment (%=): This operator calculates the remainder after dividing a variable by the specified value and assigns the remainder to the same variable.
    Example: a %= 5; is equivalent to a = a % 5;
  6. Increment Operator (++): This operator increases the value of a variable by one.
    Example: a++; is equivalent to a = a + 1;
  7. Decrement Operator (--): This operator decreases the value of a variable by one.
    Example: a--; is equivalent to a = a - 1;
shaalaa.com
  क्या इस प्रश्न या उत्तर में कोई त्रुटि है?
अध्याय 6: Variables and Expressions - EXERCISE [पृष्ठ १३१]

APPEARS IN

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

Englishहिंदीमराठी


      Forgot password?
Use app×