What will be the output of the program?


			  		

Loading

Choose the correct option.

What will be the output of the program?

public class ExamQuestion6 {     
static int x;
boolean catch() {
x++;
return true;
}
public static void main(String[] args) {
x=0;
if ((catch() | catch()) || catch())
x++;
System.out.println(x);
}
}

 

A. 1
B. 2
C. 3
D. compilation fails