Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8597551
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T00:56:19+00:00 2026-06-12T00:56:19+00:00

I have very simple question. I am not using it but I have curiosity

  • 0

I have very simple question. I am not using it but I have curiosity to know the answer. Can we execute multiple statements in catch block only if the exception get catched? I mean in my code below will both statement will get executed or not? Let me add some code snippet to make it clear..

I have found this link but not giving me the answer to my question.
link Click Here

The above link I found in this question asked by someone but It has very blurry code so hard to understand.
stackoverflow Link

try {
    int x = doXProcess();
    int y = doYProcess();
} catch (Exception e) {
    System.out.println("Error related x: " x + e.printStackTrace());
    System.out.println("Error related y: " y + e.printStackTrace());
}

Thanks you for your help and time.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T00:56:20+00:00Added an answer on June 12, 2026 at 12:56 am

    It is common to see multiple statements in a try block.

    If an exception occurs on the first line, the second line is not executed. Execution stops on any line where an exception is thrown; no lines past that point in the block are executed — execution proceeds directly to the catch block.

    If an exception is thrown from the catch block, execution again stops at the line on which the exception occurred. From there you go to a finally block, if one is defined.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a very simple question, but I have not managed to find any
Hopefully a question with a very simple answer, but it's not one that I've
I have a really simple question here, but I just can't find an answer
i have a very simple question, actually this is not the question, this is
I have a very simple question, How can I get the POST values from
I have a very simple question for which I can't seem to find an
I have a question that is probably very simple, but I cannot find an
Hopefully a very simple question. But I'm using Code First with an MVC app
I think that's a very simple question, but I can't deal with it: I
I have a very simple (rather stupid) question, I hope someone can clear my

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.