fork download
  1. public class test2 {
  2.  
  3. public static void main(String[] args) {
  4.  
  5. String input = "99#7";
  6. int number;
  7. try{
  8. number = Integer.parseInt(input);
  9. }
  10. number = 0;
  11. }
  12. catch(RuntimeException ex){
  13. number = 1;
  14. }
  15. catch(Exception ex){
  16. number = -1;
  17. }
  18. System.out.println(number);
  19. }
  20. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
Main.java:1: error: class test2 is public, should be declared in a file named test2.java
public class test2 {
       ^
1 error
stdout
Standard output is empty