#netbeans program doesnt run
1 messages · Page 1 of 1 (latest)
<@&987246883653156906> please have a look, thanks.
it is running. its waiting for u to input sth into the console and hit enter 🙂
it says
run:
Provide your password: : (add password here)
note that u should not use try-with-resources over a Scanner tied to System.in. scanners tied to that should not be closed
yes. put ur cursor there, enter sth and hit the enter key
okay thanks guys i’ll give it a try right now , i appreciate it .
very new to coding
same here
no worries
never used try before what does it do if you don't mind me asking? we can all learn together
mind if i add add on discord?
add what
its a mechanism to catch exceptions and act on them. in this particular case (try-with-resources) its to ensure that the given resource is closed in all cases, also in presence of exceptions
but since scanners tied to System.in shouldn't be closed its misplaced here
can you give me an example where it would be useful?
in all other cases when u work with resources. for example when dealing with files or databases or internet