Wish to have some nice time? Check out what I'm reading online!

Java Blog

This is my blog on java, servlets, JSP and design patterns. This might help you to keep your java knowledge updated and also to prepare for your java interview, sun java certification. Its all there, it is left to you how to use it! I started this blog with a selfish reason, just to keep my java knowledge updated and to keep log of the questions that arise in my mind. Now it has turned out to be a full blown java tutorial site with lots of java interview questions and articles. Good day!

Recent Java Articles:

NullPointerException, null – Bad, good and ugly

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 [...]

May 14th, 2009

Differentiate JVM JRE JDK JIT

Diagram to show the relations between JVM JRE JDK
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 [...]

May 10th, 2009

Servlet JSP Communication

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 [...]

April 8th, 2009

What are the causes of exceptions in java?

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 [...]

October 15th, 2008

Explain type of exceptions or checked vs unchecked exceptions in java.

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 [...]

October 14th, 2008

Explain the java this keyword.

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 [...]

August 29th, 2008

Is javadoc comment a type of standard java comment?

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 [...]

July 23rd, 2008

Check list for Internationalization (I18n)

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 [...]

July 20th, 2008

What is scoped memory and why java uses it?

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 [...]

July 17th, 2008

What is a static import in java?

First lets understand what does “java import” does to your java program! Consider the java import statements: 1) import package.ClassA; 2) import package.*; Java statement (1) gives you a license to use ClassA inside the whole program without the package reference. That is you can use like ClassA obj = new ClassA(); or ClassA.getStatic(); Java statement (2) allows you [...]

June 14th, 2008