Session Management_ Jsp And Api — Part 2 MCQs with Explanations
Practice high-yield Programming & Software Development MCQs on Session Management_ Jsp And Api — Part 2 with worked academic solutions for FPSC, PPSC, NTS, NITB, PTS.
Questions
35
Difficulty Level
Exam-Level
Target Exams
FPSC, PPSC, NTS...
Estimated Time
42 mins
Exam-Level FPSC PPSC NTS NITB PTS
Verified for Commission Syllabus • Oct 14, 2026
35
Verified Practice Questions
Interactive test mode with detailed academic worked solutions
Live Progress|0/35 answered
✓0 correct
✗0 wrong
0% score
🎉 Set complete! All 35 questions answered.
Question 1 of 35
★ FPSC
★ PPSC
★ FPSC
★ PPSC
Which of the following is not a marker interface?
Correct Answer: Option D — Reader
Detailed Academic Explanation:
Reader is the correct answer to “Which of the following is not a marker interface”. This question is standard in competitive examination syllabi for Session Management_ Jsp And Api.
💡Key Conceptual Anchor:Session Management_ Jsp And Api
Question 2 of 35
★ FPSC
★ PPSC
★ FPSC
★ PPSC
What are the components of a marker interface?
Correct Answer: Option D — No fields, No methods
Detailed Academic Explanation:
No fields, No methods is the correct answer to “What are the components of a marker interface”. This question is standard in competitive examination syllabi for Session Management_ Jsp And Api.
💡Key Conceptual Anchor:Session Management_ Jsp And Api
Question 3 of 35
★ FPSC
★ PPSC
★ FPSC
★ PPSC
Default value of autoFlush attribute is?
Correct Answer: Option A — true
Detailed Academic Explanation:
true is the correct answer to “Default value of autoFlush attribute is”. This question is standard in competitive examination syllabi for Session Management_ Jsp And Api.
💡Key Conceptual Anchor:Session Management_ Jsp And Api
Question 4 of 35
★ FPSC
★ PPSC
★ FPSC
★ PPSC
How method can be invoked on unknown object?
Correct Answer: Option C — obj.getClass().getMethod()
Detailed Academic Explanation:
obj.getClass().getMethod() is the correct answer to “How method can be invoked on unknown object”. This question is standard in competitive examination syllabi for Session Management_ Jsp And Api.
💡Key Conceptual Anchor:Session Management_ Jsp And Api
Question 5 of 35
★ FPSC
★ PPSC
★ FPSC
★ PPSC
Which method creates unique fields in the HTML which are not shown to the user?
Correct Answer: Option C — HTML Hidden field
Detailed Academic Explanation:
HTML Hidden field is the correct answer to “Which method creates unique fields in the HTML which are not shown to the user”. This question is standard in competitive examination syllabi for Session Management_ Jsp And Api.
💡Key Conceptual Anchor:Session Management_ Jsp And Api
Question 6 of 35
★ FPSC
★ PPSC
★ FPSC
★ PPSC
SessionIDs are stored in cookies.
Correct Answer: Option A — True
Detailed Academic Explanation:
True is the correct answer to “SessionIDs are stored in cookies.”. This question is standard in competitive examination syllabi for Session Management_ Jsp And Api.
💡Key Conceptual Anchor:Session Management_ Jsp And Api
Question 7 of 35
★ FPSC
★ PPSC
★ FPSC
★ PPSC
Java code is embedded under which tag in JSP?
Correct Answer: Option B — Scriptlet
Detailed Academic Explanation:
Scriptlet is the correct answer to “Java code is embedded under which tag in JSP”. This question is standard in competitive examination syllabi for Session Management_ Jsp And Api.
💡Key Conceptual Anchor:Session Management_ Jsp And Api
Question 8 of 35
★ FPSC
★ PPSC
★ FPSC
★ PPSC
What temporarily redirects response to the browser?
Correct Answer: Option C — response.sendRedirect(URL)
Detailed Academic Explanation:
response.sendRedirect(URL) is the correct answer to “What temporarily redirects response to the browser”. This question is standard in competitive examination syllabi for Session Management_ Jsp And Api.
💡Key Conceptual Anchor:Session Management_ Jsp And Api
Question 9 of 35
★ FPSC
★ PPSC
★ FPSC
★ PPSC
_jspService() method of HttpJspPage class should not be overridden.
Correct Answer: Option A — True
Detailed Academic Explanation:
True is the correct answer to “_jspService() method of HttpJspPage class should not be overridden.”. This question is standard in competitive examination syllabi for Session Management_ Jsp And Api.
💡Key Conceptual Anchor:Session Management_ Jsp And Api
Question 10 of 35
★ FPSC
★ PPSC
★ FPSC
★ PPSC
Which of the below is not a session tracking method?
Correct Answer: Option B — History
Detailed Academic Explanation:
History is the correct answer to “Which of the below is not a session tracking method”. This question is standard in competitive examination syllabi for Session Management_ Jsp And Api.
💡Key Conceptual Anchor:Session Management_ Jsp And Api
Question 11 of 35
★ FPSC
★ PPSC
★ FPSC
★ PPSC
Autocloseable was introduced in which Java version?
Correct Answer: Option A — java SE 7
Detailed Academic Explanation:
java SE 7 is the correct answer to “Autocloseable was introduced in which Java version”. This question is standard in competitive examination syllabi for Session Management_ Jsp And Api.
💡Key Conceptual Anchor:Session Management_ Jsp And Api
Question 12 of 35
★ FPSC
★ PPSC
★ FPSC
★ PPSC
Which is not a directive?
Correct Answer: Option C — export
Detailed Academic Explanation:
export is the correct answer to “Which is not a directive”. This question is standard in competitive examination syllabi for Session Management_ Jsp And Api.
💡Key Conceptual Anchor:Session Management_ Jsp And Api
Question 13 of 35
★ FPSC
★ PPSC
★ FPSC
★ PPSC
Which object is used by spring for authentication?
Correct Answer: Option D — SecurityContextHolder
Detailed Academic Explanation:
SecurityContextHolder is the correct answer to “Which object is used by spring for authentication”. This question is standard in competitive examination syllabi for Session Management_ Jsp And Api.
💡Key Conceptual Anchor:Session Management_ Jsp And Api
Question 14 of 35
★ FPSC
★ PPSC
★ FPSC
★ PPSC
Which option is true about session scope?
Correct Answer: Option B — Objects are accessible only from the pages which are in same session
Detailed Academic Explanation:
Objects are accessible only from the pages which are in same session is the correct answer to “Which option is true about session scope”. This question is standard in competitive examination syllabi for Session Management_ Jsp And Api.
💡Key Conceptual Anchor:Session Management_ Jsp And Api
Question 15 of 35
★ FPSC
★ PPSC
★ FPSC
★ PPSC
How private field can be called using reflection?
Correct Answer: Option A — getDeclaredFields
Detailed Academic Explanation:
getDeclaredFields is the correct answer to “How private field can be called using reflection”. This question is standard in competitive examination syllabi for Session Management_ Jsp And Api.
💡Key Conceptual Anchor:Session Management_ Jsp And Api
Question 16 of 35
★ FPSC
★ PPSC
★ FPSC
★ PPSC
AutoCloseable and Flushable are part of which package?
Correct Answer: Option A — Autocloseable java.lang; Flushable java.io
Detailed Academic Explanation:
Autocloseable java.lang; Flushable java.io is the correct answer to “AutoCloseable and Flushable are part of which package”. This question is standard in competitive examination syllabi for Session Management_ Jsp And Api.
💡Key Conceptual Anchor:Session Management_ Jsp And Api
Question 17 of 35
★ FPSC
★ PPSC
★ FPSC
★ PPSC
It is a good practise to not throw which exception in close() method of autocloseable?
Correct Answer: Option C — InterruptedException
Detailed Academic Explanation:
InterruptedException is the correct answer to “It is a good practise to not throw which exception in close() method of autocloseable”. This question is standard in competitive examination syllabi for Session Management_ Jsp And Api.
💡Key Conceptual Anchor:Session Management_ Jsp And Api
Question 18 of 35
★ FPSC
★ PPSC
★ FPSC
★ PPSC
Which attribute uniquely identification element?
Correct Answer: Option A — ID
Detailed Academic Explanation:
ID is the correct answer to “Which attribute uniquely identification element”. This question is standard in competitive examination syllabi for Session Management_ Jsp And Api.
💡Key Conceptual Anchor:Session Management_ Jsp And Api
Question 19 of 35
★ FPSC
★ PPSC
★ FPSC
★ PPSC
What is not the advantage of Reflection?
Correct Answer: Option C — Examine a class's field at compile time
Detailed Academic Explanation:
Examine a class's field at compile time is the correct answer to “What is not the advantage of Reflection”. This question is standard in competitive examination syllabi for Session Management_ Jsp And Api.
💡Key Conceptual Anchor:Session Management_ Jsp And Api
Question 20 of 35
★ FPSC
★ PPSC
★ FPSC
★ PPSC
What is the alternative of using finally to close resource?
Correct Answer: Option B — autocloseable interface to be implemented
Detailed Academic Explanation:
autocloseable interface to be implemented is the correct answer to “What is the alternative of using finally to close resource”. This question is standard in competitive examination syllabi for Session Management_ Jsp And Api.
💡Key Conceptual Anchor:Session Management_ Jsp And Api
Question 21 of 35
★ FPSC
★ PPSC
★ FPSC
★ PPSC
How to get the class object of associated class using Reflection?
Correct Answer: Option A — Class.forName("className")
Detailed Academic Explanation:
Class.forName("className") is the correct answer to “How to get the class object of associated class using Reflection”. This question is standard in competitive examination syllabi for Session Management_ Jsp And Api.
💡Key Conceptual Anchor:Session Management_ Jsp And Api
Question 22 of 35
★ FPSC
★ PPSC
★ FPSC
★ PPSC
What does Class.forName("myreflection.Foo").getInstance() return?
Correct Answer: Option D — Foo object
Detailed Academic Explanation:
Foo object is the correct answer to “What does Class.forName("myreflection.Foo").getInstance() return”. This question is standard in competitive examination syllabi for Session Management_ Jsp And Api.
💡Key Conceptual Anchor:Session Management_ Jsp And Api
Question 23 of 35
★ FPSC
★ PPSC
★ FPSC
★ PPSC
Which of the following leads to high network traffic?
Correct Answer: Option A — URL rewriting
Detailed Academic Explanation:
URL rewriting is the correct answer to “Which of the following leads to high network traffic”. This question is standard in competitive examination syllabi for Session Management_ Jsp And Api.
💡Key Conceptual Anchor:Session Management_ Jsp And Api
Question 24 of 35
★ FPSC
★ PPSC
★ FPSC
★ PPSC
What is the use of Flushable interface?
Correct Answer: Option A — Flushes this stream by writing any buffered output to the underlying stream
Detailed Academic Explanation:
Flushes this stream by writing any buffered output to the underlying stream is the correct answer to “What is the use of Flushable interface”. This question is standard in competitive examination syllabi for Session Management_ Jsp And Api.
💡Key Conceptual Anchor:Session Management_ Jsp And Api
Question 25 of 35
★ FPSC
★ PPSC
★ FPSC
★ PPSC
Which one of the following is correct for directive in JSP?
Correct Answer: Option A — <%@directive%>
Detailed Academic Explanation:
<%@directive%> is the correct answer to “Which one of the following is correct for directive in JSP”. This question is standard in competitive examination syllabi for Session Management_ Jsp And Api.
💡Key Conceptual Anchor:Session Management_ Jsp And Api
Question 26 of 35
★ FPSC
★ PPSC
★ FPSC
★ PPSC
What is the maximum size of cookie?
Correct Answer: Option A — 4 KB
Detailed Academic Explanation:
4 KB is the correct answer to “What is the maximum size of cookie”. This question is standard in competitive examination syllabi for Session Management_ Jsp And Api.
💡Key Conceptual Anchor:Session Management_ Jsp And Api
Question 27 of 35
★ FPSC
★ PPSC
★ FPSC
★ PPSC
Which one is the correct order of phases in JSP life cycle?
Correct Answer: Option C — Compilation, Initialization, Execution, Cleanup
Detailed Academic Explanation:
Compilation, Initialization, Execution, Cleanup is the correct answer to “Which one is the correct order of phases in JSP life cycle”. This question is standard in competitive examination syllabi for Session Management_ Jsp And Api.
💡Key Conceptual Anchor:Session Management_ Jsp And Api
Question 28 of 35
★ FPSC
★ PPSC
★ FPSC
★ PPSC
Which tag is used to set a value of a JavaBean?
Correct Answer: Option A — <c:set>
Detailed Academic Explanation:
<c:set> is the correct answer to “Which tag is used to set a value of a JavaBean”. This question is standard in competitive examination syllabi for Session Management_ Jsp And Api.
💡Key Conceptual Anchor:Session Management_ Jsp And Api
Question 29 of 35
★ FPSC
★ PPSC
★ FPSC
★ PPSC
Which tag should be used to pass information from JSP to included JSP?
Correct Answer: Option A — Using <%jsp:page> tag
Detailed Academic Explanation:
Using <%jsp:page> tag is the correct answer to “Which tag should be used to pass information from JSP to included JSP”. This question is standard in competitive examination syllabi for Session Management_ Jsp And Api.
💡Key Conceptual Anchor:Session Management_ Jsp And Api
Question 30 of 35
★ FPSC
★ PPSC
★ FPSC
★ PPSC
Application is instance of which class?
Correct Answer: Option D — javax.servlet.ServletContext
Detailed Academic Explanation:
javax.servlet.ServletContext is the correct answer to “Application is instance of which class”. This question is standard in competitive examination syllabi for Session Management_ Jsp And Api.
💡Key Conceptual Anchor:Session Management_ Jsp And Api
Question 31 of 35
★ FPSC
★ PPSC
★ FPSC
★ PPSC
Which of the following is used for session migration?
Correct Answer: Option A — Persisting the session in database
Detailed Academic Explanation:
Persisting the session in database is the correct answer to “Which of the following is used for session migration”. This question is standard in competitive examination syllabi for Session Management_ Jsp And Api.
💡Key Conceptual Anchor:Session Management_ Jsp And Api
Question 32 of 35
★ FPSC
★ PPSC
★ FPSC
★ PPSC
What does foo.getClass().getMethod("doSomething", null) return?
Correct Answer: Option B — Method is returned and we can call the method as method.invoke(foo,null)
Detailed Academic Explanation:
Method is returned and we can call the method as method.invoke(foo,null) is the correct answer to “What does foo.getClass().getMethod("doSomething", null) return”. This question is standard in competitive examination syllabi for Session Management_ Jsp And Api.
💡Key Conceptual Anchor:Session Management_ Jsp And Api
Question 33 of 35
★ FPSC
★ PPSC
★ FPSC
★ PPSC
Which of the following is not true about session?
Correct Answer: Option C — Default timeout value for session variable is 20 minutes
Detailed Academic Explanation:
Default timeout value for session variable is 20 minutes is the correct answer to “Which of the following is not true about session”. This question is standard in competitive examination syllabi for Session Management_ Jsp And Api.
💡Key Conceptual Anchor:Session Management_ Jsp And Api
Question 34 of 35
★ FPSC
★ PPSC
★ FPSC
★ PPSC
How private method can be called using reflection?
Correct Answer: Option B — getDeclaredMethods
Detailed Academic Explanation:
getDeclaredMethods is the correct answer to “How private method can be called using reflection”. This question is standard in competitive examination syllabi for Session Management_ Jsp And Api.
💡Key Conceptual Anchor:Session Management_ Jsp And Api
Question 35 of 35
★ FPSC
★ PPSC
★ FPSC
★ PPSC
"out" is implicit object of which class?
Correct Answer: Option D — javax.servlet.jsp.JspWriter
Detailed Academic Explanation:
javax.servlet.jsp.JspWriter is the correct answer to “"out" is implicit object of which class”. This question is standard in competitive examination syllabi for Session Management_ Jsp And Api.
💡Key Conceptual Anchor:Session Management_ Jsp And Api
✓Link copied to clipboard
Continue Your Practice
Advance Html — Part 1
Master the next curriculum module with 40 exam-standard MCQs.
💡Examiner's Advisory for Programming & Software Development
In competitive commission exams (FPSC, PPSC, KPPSC, SPSC, CSS, PMS), questions are frequently phrased with distractor options designed to catch rote learners. Whenever you answer an MCQ, read the Detailed Academic Explanation and Conceptual Anchor to understand why the remaining options are incorrect.