1) The proposed solution had something I really haven't seen before and wanted to ask about : Is legal to have a try block without a catch block ?
Another thing I would be happy to find an answer to :
2)I created a file.txt in desktop and tried to run the code of the task that determines how many commas are in the file . But I always get the error : access denied . I runned my IDEA as administrator , but I still get the same error .Should the access properties of the file be changed ? Any thoughts of how I get access to files ?
try without catch?
In der Diskussion
Kommentare (2)
- Beliebt
- Neu
- Alt
Du musst angemeldet sein, um einen Kommentar schreiben zu können
Lisa L
5 Juni 2022, 19:17nützlich
possible if you use a try finally combination
it also is possible in a try-with-resources block if you throw up the exception
+1
Sakka Mouid
5 Juni 2022, 20:19
Okay the second possibility is something new for me 😙
0