Page 1 of 1

About Question enthuware.ocpjp.v17.2.3661:

Posted: Sun Nov 24, 2024 9:52 pm
by byronvoyle
Hello, since try-with-resources should not have a finally block. So it will end with a compilation error right? Thanks.

Re: About Question enthuware.ocpjp.v17.2.3661:

Posted: Sun Nov 24, 2024 10:54 pm
by admin
A a try-with-resources can certainly have a finally block. Where did you read that it should not have a finally block?
Try writing a simple program to test it out.