Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package p1;
- public class ExempluTryCatch {
- public static void main(String args[])
- {
- int values[]=new int[10];
- try
- {System.out.println("exemplu de tratare a exceptiei");
- values[11]=10;
- }
- catch(ArrayIndexOutOfBoundsException a)
- {
- System.out.println("prinderea exceptiei");
- System.out.println("index invalid" );
- //a.printStackTRace(); --arata linia unde avem eroarea;
- }
- finally{System.out.println("Sfarsit bloc");
- }
- }}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement