Computer Applications
ch += 2 is equivalent to
- ch = ch + 2
- ch + 2
- ch =+ 2
- none of the above
Java Operators
8 Likes
Answer
ch = ch + 2
Reason — += is a shorthand operator. The operator pair += tells the compiler to assign to ch the value of ch + 2.
Answered By
4 Likes
Related Questions
Which of the following does not represent a character literal ?
- 'a'
- '1'
- '\a'
- "a"
Which keyword turns a variable declaration into constant declaration ?
- const
- constant
- final
- fixed
The Math class is part of which Java library package.
- java.util
- java.io
- java.random
- java.lang
Which clause is optional in a switch statement?
- switch
- case
- default
- none of the above