Java Interview Questions
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 Java Interview Questions (FAQ):
Add jsp_precompile as a request parameter and send a request to the JSP file. This will make the jsp pre-compile. Why it is mentioned as pre compile instead of compilation is that, the request is not served. That is, the JSP will not be executed and the request will not be serviced. Just it will [...]
NullPointerException: An attempt was made to use a null reference in a case where an object reference was required.
NullPointerException is more famous to Java programmers, than fashion to Paris. When you start breaking the beurette and Pipette in Java lab, first thing you will get is NullPointerException. In this tutorial lets discuss about, do we [...]
Java Virtual Machine (JVM) is an abstract computing machine. Java Runtime Environment (JRE) is an implementation of the JVM. Java Development Kit (JDK) contains JRE along with various development tools like Java libraries, Java source compilers, Java debuggers, bundling and deployment tools.
JVM becomes an instance of JRE at runtime of a java program. It is [...]
getServletConfig().getServletContext().getRequestDispatcher(”jspfilepathtoforward”).forward(request, response);
The above line is essence of the answer for “How does a servlet communicate with a JSP page?”
When a servlet jsp communication is happening, it is not just about forwarding the request to a JSP from a servlet. There might be a need to transfer a string value or on object itself.
Following is a [...]
A java exception can be thrown only in the following three scenarios:
(1) An abnormal execution condition was synchronously detected by the Java virtual machine.
- When evaluation of an expression violates the normal semantics (Example: an integer divide by zero)
- An error occurs in loading or linking part of the program
- When limitation on a resource [...]
Type of exceptions in java are checked exceptions and unchecked exceptions. This classification is based on compile-time checking of exceptions. There is also a classification based on runtime in java. It is not widely known! That is synchronous and asynchronous exceptions. First let us see the java checked exceptions and unchecked exceptions.
Checked Exceptions Vs Unchecked [...]
This definition:
Java’s ‘this’ keyword is used to refer the current instance of the method on which it is used.
Following are the ways to use this
1) To specifically denote that the instance variable is used instead of static or local varible.That is,
private String javaFAQ;
void methodName(String javaFAQ) {
this.javaFAQ = javaFAQ;
}
Here this refers to the instance variable. Here [...]
How many types of java comments are there? Everybody knows there are two types of java comments available. Now the misunderstood part starts. What are those two types of java comments?
The (ยง3.7) Java Language Specification Third Edition says,
Traditional Comment
End of line Comment
What happened to the documentation comment or javadoc comment?
No it is not a type [...]
This check list for Internationalization (I18n) will cater to the need of programmers irrespective of the language java /dot net/ j2ee / any other.
Translatable items
GUI - Labels and Menu items
User messages including third party component generated
Log / system generated messages
Help - Online help / manual and other deliverable documentation
Installation notes [...]
In java, a frequent occurence of a common phenomenon related to memory management is creation and destruction of temporary objects. What are java temporary objects? For example in java, when two strings are concatenated, a StringBuffer object is created. As two Java String objects cannot be added directly (immutable property), a helper object StringBuffer is [...]