41.How to create a session in servlet? You would get HttpSession object by calling the public method getSession() of HttpServletRequest, as below: // Create a session object if it is …
Interview Questions
- Interview Questions and AnswersServletsTechnical Interview Questions and Answers
- Interview Questions and AnswersServletsTechnical Interview Questions and Answers
Servlets Interview Questions and Answers For Freshers Part-4
by Sby S31.Can multiple filters be configured? Yes. 32.Can filtering be done in an ordered way? If so then how to achieve it? Yes. The order of filter-mapping elements in web.xml determines …
- Interview Questions and AnswersServletsTechnical Interview Questions and Answers
Servlets Interview Questions and Answers For Freshers Part-3
by Sby S21.How to send an authentication error from a servlet? We can use setStatus(statuscode) method of HttpServletResponse to send an authentication error. // Set error code and reason. response.sendError(407, “Need authentication!!!” …
- Interview Questions and AnswersServletsTechnical Interview Questions and Answers
Servlets Interview Questions and Answers For Freshers Part-2
by Sby S11.For what purpose destroy() method of a servlet is used? This method gives your servlet a chance to close database connections, halt background threads, write cookie lists or hit counts …
- Interview Questions and AnswersServletsTechnical Interview Questions and Answers
Servlets Interview Questions and Answers For Freshers Part-1
by Sby S1.What are Servlets? Java Servlets are programs that run on a Web or Application server and act as a middle layer between a request coming from a Web browser or …
- Interview Questions and AnswersJavaTechnical Interview Questions and Answers
Java Interview Questions and Answers For Graduates Part-5
by Sby S41.What is Polymorphism? Polymorphism is the ability of an object to take on many forms. The most common use of polymorphism in OOP occurs when a parent class reference is …
- Interview Questions and AnswersJavaTechnical Interview Questions and Answers
Java Interview Questions and Answers For Graduates Part-4
by Sby S31.What is an Exception? An exception is a problem that arises during the execution of a program. Exceptions are caught by handlers positioned along the thread’s method invocation stack.
- Interview Questions and AnswersJavaTechnical Interview Questions and Answers
Java Interview Questions and Answers For Graduates Part-3
by Sby S21.What do you mean by synchronized Non Access Modifier? Java provides these modifiers for providing functionalities other than Access Modifiers, synchronized used to indicate that a method can be accessed …
- Interview Questions and AnswersJavaTechnical Interview Questions and Answers
Java Interview Questions and Answers For Graduates Part-2
by Sby S11.What is a Class Variable? These are variables declared with in a class, outside any method, with the static keyword.
- Interview Questions and AnswersJavaTechnical Interview Questions and Answers
Java Interview Questions and Answers For Graduates Part-1
by Sby S1.What do you know about Java? Java is a high-level programming language originally developed by Sun Microsystems and released in 1995. Java runs on a variety of platforms, such as …