2
public static void main(String[] args)
{
    int h = 30;
    h ^= (h >>> 20) ^ (h >>> 12);
    System.out.println(h);
}

If int h = 30 whose binary is 0001 1110. After operation what value will stored in h?

Burkhard
  • 14,596
  • 22
  • 87
  • 108
Vicky S
  • 33
  • 5
  • 3
    Write the whole lot out in binary on paper, taking care of the order of evaluation of the expression. All rather boring really. If you are just curious about the value, then run the code. – Bathsheba Jun 20 '17 at 07:25
  • it's explained in another thread. https://stackoverflow.com/questions/9335169 – Sudeep nayak Jun 20 '17 at 07:27
  • Just see [operators](https://docs.oracle.com/javase/tutorial/java/nutsandbolts/operators.html) order to get an idea of what will happen. For the value, you already print it, but the process is not that complicated, just need to understand each [operator](http://docs.oracle.com/javase/tutorial/java/nutsandbolts/op3.html) (do you ?). – AxelH Jun 20 '17 at 07:27

0 Answers0