Java FAQ

We offer you quality collection of Java FAQ from core java, jsp and servlet. These java FAQ will help you to prepare for career java interview, java certification, college tests and campus interview. It will also help to update your java knowledge.

Recently Added Questions:

What is preinitialization of a java servlet?

In the java servlet life cycle, the first phase is called 'Creation and intialization'. The java servlet container first creates the servlet instance and then executes the init() method. This initialization can be done in three ways. The default way is that, the java servlet is initialized when the servlet is called for the first time. This type of servlet initialization is called lazy loading....

Difference between forward and sendRedirect

forward Control can be forward to resources available within the server from where the call is made. This transfer of control is done by the container internally and browser / client is not involved. This is the major difference between forward and sendRedirect. When the forward is done, the original request and response objects are transfered along with additional parameters if needed. redire...

What are the types of JSP Comments?

There is only one type of JSP comment available by JSP specification. JSP Syntax: <%-- comment --%> This JSP comment tag tells the JSP container to ignore the comment part from compilation. That is, it is not considered for the content parsed for 'response'. Example: <%-- This JSP comment part will not be included in the response object --%> Important Points: <!-- com...

Explain the java static modifier

Static Variables or Class Variables Java instance variables are given separate memory for storage. If there is a need for a variable to be common to all the objects of a single java class, then the static modifier should be used in the variable declaration. Any java object that belongs to that class can modify its static variables. Also, an instance is not a must to modify the static varia...

Difference between static and non-static java inner class.

A static java inner class cannot have instances. A non-static java inner class can have instances that belong to the outer class....

Can a java subclass declare a private method available in its java superclass?

Yes. A java private member cannot be inherited as it is available only to the declared java class. Since the private members cannot be inherited, there is no place for discussion on java runtime overloading or java overriding (polymorphism) features....