Home » JAVA Programming » Basic Operators » Question
  1. What is the output of this program?

    public class increment _Example
    {
    public static void main(String args[])
    {
    int a = 5;
    System.out.print(++a * 10);
    }
    }
    1. 50
    2. 60
    3. 70
    4. 80
    5. 90
Correct Option: B

Operator ++ has more preference than *, thus a becomes 6 and when multiplied by 10 gives 60.
output: 60



Your comments will be displayed only after manual approval.