Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New Coder
    Join Date
    Jan 2011
    Posts
    15
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Question Exception Handling Problems

    Whenever I put something within my try-catch blocks, I get this error cannot find symbol when I have already defined everything clearly for each try-catch blocks. None of the try catch blocks work, dunno why.

  • #2
    New Coder
    Join Date
    Jan 2011
    Location
    India
    Posts
    31
    Thanks
    0
    Thanked 4 Times in 4 Posts
    Put you code here.... so that we can help

    The following are the reason for "cannot find symbol" error during compilation-

    1)When a programmer misspelled the name of the class.

    2When a programmer do not Imported the class name.

    Check the number of curly braces you put in the code

  • #3
    New Coder
    Join Date
    Feb 2011
    Posts
    48
    Thanks
    1
    Thanked 2 Times in 2 Posts
    If you are declaring your variables inside the try block, in the catch block they are outside of scope. Declare all your variables which are needed in the exception handling outside your try block and voila, you can use your variables...


  •  

    Tags for this Thread

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •