Home » JAVA Programming » Basic Operators » Question
  1. Which of these lines of code will give better performance?

    1. p | 8 + r >> q & 10;
    2. (p | ((( 8 * r) >> q ) & 10 ))
    1. 2 will give better performance as it has parentheses.
    2. Dependent on the computer system.
    3. 1 will give better performance as it has no parentheses.
    4. Both 1 & 2 will give equal performance.
    5. None of these
Correct Option: D

Parentheses do not degrade the performance of the program. Adding parentheses to reduce ambiguity does not negatively affect your system.



Your comments will be displayed only after manual approval.