in Education by
It is a good practise to not throw which exception in close() method of autocloseable? (a) IOException (b) CustomException (c) InterruptedException (d) CloseException This question was addressed to me during an online interview. My doubt stems from AutoCloseable, Closeable and Flushable Interfaces in portion Session Management, JSP & API of Java Select the correct answer from above options JavaScript questions and answers, JavaScript questions pdf, JavaScript question bank, JavaScript questions and answers pdf, mcq on JavaScript pdf, JavaScript questions and solutions, JavaScript mcq Test , Interview JavaScript questions, JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)

1 Answer

0 votes
by
Correct option is (c) InterruptedException To explain I would say: InterruptedException interacts with a thread’s interrupted status and runtime misbehavior is likely to occur if an InterruptedException is suppressed.

Related questions

0 votes
0 votes
    Which method is used to close the WebSocket? (a) Socket.flush() (b) Socket.close() (c) Socket. ... , JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Oct 22, 2021 in Education by JackTerrance
0 votes
    Autocloseable was introduced in which Java version? (a) java SE 7 (b) java SE 8 (c) java SE 6 ... , JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Oct 24, 2021 in Education by JackTerrance
0 votes
    Which of the below is a child interface of Autocloseable? (a) Closeable (b) Close (c) Auto (d) ... , JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Oct 24, 2021 in Education by JackTerrance
0 votes
    What is the difference between AutoCloseable and Closeable? (a) Closeable is an interface and AutoCloseable is ... for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Oct 24, 2021 in Education by JackTerrance
0 votes
    Which exception is thrown by read() method? (a) IOException (b) InterruptedException (c) SystemException (d ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Oct 24, 2021 in Education by JackTerrance
0 votes
    Which of these keywords is not a part of exception handling? (a) try (b) finally (c) thrown (d) ... , JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Oct 25, 2021 in Education by JackTerrance
0 votes
0 votes
    Which part of code gets executed whether exception is caught or not? (a) finally (b) try (c) ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Oct 25, 2021 in Education by JackTerrance
0 votes
    What is the alternative of using finally to close resource? (a) catch block (b) autocloseable interface to ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Oct 24, 2021 in Education by JackTerrance
...