fork download
  1. public class test
  2. {
  3. public static void main(String args[])
  4. {
  5. int x = 0, y = 1, z;
  6. if(x)
  7. z = 0;
  8. else
  9. z = 1;
  10. if(y)
  11. z = 2;
  12. else
  13. z = 3;
  14. System.out.println(z);
  15. }
  16. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
Main.java:1: error: class test is public, should be declared in a file named test.java
public class test
       ^
Main.java:6: error: incompatible types: int cannot be converted to boolean
if(x) 
   ^
Main.java:10: error: incompatible types: int cannot be converted to boolean
if(y) 
   ^
3 errors
stdout
Standard output is empty