Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Etest{
- private static int check(int n)
- throws Exception
- {
- if (n<0)
- throw new Exception(n + " is negative.");
- return n;
- }
- public static void main(String[] args){
- int s = 0;
- try{
- s += check(-1);
- }catch(Exception e){
- System.out.println(e.getMessage());
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement