Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class ExceptionTest {
- static void checkavailbility(int i) throws ResourceNotFound
- {
- if(i>0)
- {
- System.out.println("items available");
- }
- else
- {
- throw new ResourceNotFound("items not available");
- }
- }
- public static void main(String args[]){
- try
- {
- checkavailbility(0);
- }
- catch(Exception e)
- {
- System.out.println("exception occured");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement