Advertisement
GreMendes

Exception

Nov 9th, 2015
116
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.27 KB | None | 0 0
  1. public class Principal {
  2.  
  3.     public static void main(String[] args) {
  4.         try{
  5.             System.out.println("Antes ");
  6.             System.out.println(10/0);          
  7.         }catch(ArithmeticException e){
  8.             System.out.println("Não da pra dividir por 0");
  9.         }
  10.         System.out.println("Depois ");
  11.     }
  12.  
  13. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement