in Education by
How private field can be called using reflection? (a) getDeclaredFields (b) getDeclaredMethods (c) getMethods (d) getFields This question was addressed to me by my school principal while I was bunking the class. I'd like to ask this question from Reflection API topic in portion Session Management, JSP & API of Java Select the correct answer from above options

1 Answer

0 votes
by
 
Best answer
The correct answer is (a) getDeclaredFields Explanation: getDeclaredFields gives instance of java.lang.reflect.Fields.

Related questions

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
    How to get the class object of associated class using Reflection? (a) Class.forName( className ) (b) Class.name( ... 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
    What is used to get class name in reflection? (a) getClass().getName() (b) getClass().getFields() (c) getClass( ... , JSP & API of Java Select the correct answer from above options...
asked Feb 22, 2022 in Education by JackTerrance
0 votes
    Can and be used alternatively in JSP? (a) True (b) False The question was asked in an online interview. My ... JSP & API of Java Select the correct answer from above options...
asked Feb 22, 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
    How can we invalidate a session? (a) session.discontinue() (b) session.invalidate() (c) session.disconnect() (d) ... JSP & API of Java Select the correct answer from above options...
asked Feb 22, 2022 in Education by JackTerrance
0 votes
    Which page directive should be used in JSP to generate a PDF page? (a) contentType (b) generatePdf (c) typePDF (d ... JSP & API of Java Select the correct answer from above options...
asked Feb 22, 2022 in Education by JackTerrance
0 votes
    Which tag should be used to pass information from JSP to included JSP? (a) Using tag (b) Using tag (c) Using ... , 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
    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
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 of the following is stored at client side? (a) URL rewriting (b) Hidden form fields (c) SSL sessions (d) ... , 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 leads to high network traffic? (a) URL rewriting (b) Hidden form fields (c) SSL sessions ( ... 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 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
...