I tried compiling and running the following code
public static void main(String... args) {
int x = 1 | 2 | 3 | 4;
//int x = 1 | 1 | 1 ;
//int x = 1 | 2 ;
//int x = 2 | 1 ;
System.out.println(x);
}
I tried in dot net and its not working how come its working in java ?? How is this code being evaluated to produce an answer ??