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

1 Answer

0 votes
by
 
Best answer
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
    Autocloseable was introduced in which Java version? (a) java SE 7 (b) java SE 8 (c) java SE 6 (d) java ... , JSP & API of Java Select the correct answer from above options...
asked Feb 16, 2022 in Education by JackTerrance
0 votes
    Which of the below is a child interface of Autocloseable? (a) Closeable (b) Close (c) Auto (d) Cloneable The ... JSP & API of Java Select the correct answer from above options...
asked Feb 16, 2022 in Education by JackTerrance
0 votes
    What is the difference between AutoCloseable and Closeable? (a) Closeable is an interface and AutoCloseable is a ... API of Java Select the correct answer from above options...
asked Feb 16, 2022 in Education by JackTerrance
0 votes
    What is the alternative of using finally to close resource? (a) catch block (b) autocloseable interface to be ... & API of Java Select the correct answer from above options...
asked Feb 16, 2022 in Education by JackTerrance
0 votes
    Does close() implicitly flush() the stream. (a) True (b) False This question was posed to me during an interview. ... JSP & API of Java Select the correct answer from above options...
asked Feb 16, 2022 in Education by JackTerrance
0 votes
    Which of the below is not a session tracking method? (a) URL rewriting (b) History (c) Cookies (d) SSL sessions ... JSP & API of Java Select the correct answer from above options...
asked Feb 22, 2022 in Education by JackTerrance
0 votes
    Which method creates unique fields in the HTML which are not shown to the user? (a) User authentication (b) URL ... JSP & API of Java Select the correct answer from above options...
asked Feb 22, 2022 in Education by JackTerrance
0 votes
    _jspService() method of HttpJspPage class should not be overridden. (a) True (b) False This question was posed to me ... & API of Java Select the correct answer from above options...
asked Feb 22, 2022 in Education by JackTerrance
0 votes
    How private method can be called using reflection? (a) getDeclaredFields (b) getDeclaredMethods (c) getMethods (d) ... API of Java Select the correct answer from above options...
asked Feb 22, 2022 in Education by JackTerrance
0 votes
    Which of the following is not true about session? (a) All users connect to the same session (b) All users have ... JSP & API of Java Select the correct answer from above options...
asked Feb 22, 2022 in Education by JackTerrance
0 votes
    Which is not a directive? (a) include (b) page (c) export (d) useBean I got this question in homework. This is ... , JSP & API of Java Select the correct answer from above options...
asked Feb 22, 2022 in Education by JackTerrance
0 votes
    Which of the following is not a marker interface? (a) Serializable (b) Cloneable (c) Remote (d) Reader This ... JSP & API of Java Select the correct answer from above options...
asked Feb 22, 2022 in Education by JackTerrance
0 votes
    What is not the advantage of Reflection? (a) Examine a class's field and method at runtime (b) Construct an ... JSP & API of Java Select the correct answer from above options...
asked Feb 22, 2022 in Education by JackTerrance
0 votes
    Which of the following is used for session migration? (a) Persisting the session in database (b) URL rewriting (c) ... & API of Java Select the correct answer from above options...
asked Feb 22, 2022 in Education by JackTerrance
...