Skip to Main Content

New to Java

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Try/Catch problem

556517Jun 10 2009 — edited Jun 10 2009
Hi,

i have function, displayShapeFile(file) which has a try/catch statement which does what i want it to do. Now i want to add another try/catch statement to deal with a different task, but placed not in the function. I want it to be a new statement. When i begin the new try/catch statement beneaf the function, i straight away get an error in the closing brace of the function and when i hover over it, it states " illegal start of type"
 public void displayShapeFile(File file) 
    {
             try {

                            // code logic
                 } catch (Exception e) {
            System.out.println(e.getMessage());
        }
    } // error here"illegal start of type"???

try {
        
    } 
Can somebody tell me why this is occuring and what i need to do to fix this?
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jul 8 2009
Added on Jun 10 2009
9 comments
131 views