Solved

return in catch statement

Posted on 2016-09-17
1
44 Views
Last Modified: 2016-09-18
Hi,

When we use return in catch statement. I never used return in catch statement myself but saw a code like that. Wondering why we use return in catch block after some system out statement giving user instructing t enter proper values? please advise
0
Comment
Question by:gudii9
1 Comment
 
LVL 14

Accepted Solution

by:
CPColin earned 500 total points
ID: 41803502
You've asked a very similar question to this one before. You would use a return statement in a catch block if you want to return from your method at that point in your code, same as using a return statement in any other block. There's really not much more to it than that.
0

Featured Post

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

INTRODUCTION Working with files is a moderately common task in Java.  For most projects hard coding the file names, using parameters in configuration files, or using command-line arguments is sufficient.   However, when your application has vi…
Java had always been an easily readable and understandable language.  Some relatively recent changes in the language seem to be changing this pretty fast, and anyone that had not seen any Java code for the last 5 years will possibly have issues unde…
Viewers will learn about the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:
This tutorial will introduce the viewer to VisualVM for the Java platform application. This video explains an example program and covers the Overview, Monitor, and Heap Dump tabs.

861 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now