Java Bitwise Operators on int and double

Question

What is the output of the following code:

class Main {/*from   w  w w.  j  ava  2s  .  c om*/

  public static void main(String args[]) {

    double d = 123.123;
    int a = 0B11001110;

    double r = d | a;
    System.out.println(r);

  }
}


Compile time error:
The operator | is undefined for the argument type(s) double, int

Note

We can only use bit operators on integer type:int, byte, short, long and char.




PreviousNext

Related