#How does Try-Count work?

1 messages · Page 1 of 1 (latest)

raw imp
#

I am trying to obtain the value of a variable outside of a Try-Catch but I am unsure of how to get that value.

Many thanks

visual sleetBOT
#

This post has been reserved for your question.

Hey @raw imp! Please use /close or the Close Post button above when you're finished. Please remember to follow the help guidelines. This post will be automatically closed after 300 minutes of inactivity.

TIP: Narrow down your issue to simple and precise questions to maximize the chance that others will reply in here.

broken sun
#

what?

#

do you mean a try-catch

#

you would declare the variable outside

raw imp
#

But what if I assign it a vaule inside of the try-catch? Like a scanner checking whether or not the input is an integer or something else?

broken sun
#

you could avoid a try-catch by checking with hasNextInt first, but my original answer doesn't change

raw imp
#

Oh ok thanks you!

visual sleetBOT
# raw imp Oh ok thanks you!

If you are finished with your post, please close it.
If you are not, please ignore this message.
Note that you will not be able to send further messages here after this post have been closed but you will be able to create new posts.