B & C are correct ---->The two key modifications that enable the code to print "Open Close" are:
Implement AutoCloseable in the Folder class.
Override the close() method in the Folder class.
B and C correct.
A is wrong cuz both Closeable and AutoCloseable are "interfaces", not classes. Therefore, the "implements" keyword must be used.
D wrong. the fact that it is "final" and doesnt throw anything is fine, but it is missing the "public" keyword. trying to compile without "public" gives this error: "attempting to assign weaker access privileges; was public"
A voting comment increases the vote count for the chosen answer by one.
Upvoting a comment with a selected answer will also increase the vote count towards that answer by one.
So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.
SrinivasJasti
2 weeks, 1 day agoxplorerpj
6 months, 3 weeks agozuluitai
6 months, 4 weeks agosupersquax
11 months, 2 weeks agoTojose
1 year ago