Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 4 of 4

Thread: Try-Catch Statement

  1. #1
    Junior Member
    Join Date
    Dec 2013
    Posts
    14
    Thanks
    9
    Thanked 0 Times in 0 Posts

    Post Try-Catch Statement

    Hi,

    Is the try catch statement used to catch syntax errors?


  2. #2
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,162
    Thanks
    65
    Thanked 2,725 Times in 2,675 Posts

    Default Re: Try-Catch Statement

    No. syntax errors are detected by the compiler, not the runtime
    If you don't understand my answer, don't ignore it, ask a question.

  3. The Following User Says Thank You to Norm For This Useful Post:

    jamesh (December 23rd, 2013)

  4. #3
    Junior Member
    Join Date
    Dec 2013
    Posts
    14
    Thanks
    9
    Thanked 0 Times in 0 Posts

    Default Re: Try-Catch Statement

    Thanks Nor.

    If a method throws an exception is it first caught by the compiler?

  5. #4
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,162
    Thanks
    65
    Thanked 2,725 Times in 2,675 Posts

    Default Re: Try-Catch Statement

    No. Exceptions happen at runtime not at compile time.
    If you don't understand my answer, don't ignore it, ask a question.

  6. The Following User Says Thank You to Norm For This Useful Post:

    jamesh (December 23rd, 2013)

Similar Threads

  1. Try and catch
    By jaydac12 in forum What's Wrong With My Code?
    Replies: 2
    Last Post: March 10th, 2013, 05:58 AM
  2. [SOLVED] A Loop statement and a switch statement issue
    By sternfox in forum Loops & Control Statements
    Replies: 13
    Last Post: March 7th, 2013, 04:19 PM
  3. Replacing an If statement with a Switch statement
    By logi in forum Loops & Control Statements
    Replies: 9
    Last Post: February 4th, 2013, 12:21 AM
  4. how do i try/catch this?
    By safra in forum Exceptions
    Replies: 6
    Last Post: October 29th, 2011, 11:14 AM
  5. catch all
    By silverspoon34 in forum Exceptions
    Replies: 1
    Last Post: November 29th, 2009, 02:18 PM

Tags for this Thread