fork download
  1. class Ex6{
  2. public static void main(String args[]){
  3. int x = 0, y=10;
  4. try{
  5. y /=x;
  6. }
  7. System.out.print("/ by 0");
  8. catch(Exception e){
  9. System.out.print("error");
  10. }
  11. } }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
Main.java:4: error: 'try' without 'catch', 'finally' or resource declarations
 try{
 ^
Main.java:8: error: 'catch' without 'try'
 catch(Exception e){
 ^
2 errors
stdout
Standard output is empty