Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class ThrowDemo
- {
- static void throwone() throws IllegalAccessException
- {
- System.out.println("Inside throwone method");
- throw new IllegalAccessException("demo");
- }
- public static void main(String[] args)
- {
- try {
- throwone();
- }
- catch (IllegalAccessException e)
- {
- System.out.println("Caught inside main");
- System.out.println(e);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement