Author Archive

J2EE Interview Questions »



Q)  What is J2EE
Rep) Java 2 Platform, Enterprise Edition.
Q)   What is J2EE application
Rep) Any deployable unit of J2EE functionality. This can be
a single J2EE module or a group of modules packaged
into an EAR file along with a J2EE application
deployment descriptor. J2EE applications are typically
engineered to be distributed across multiple computing
tiers.
Q)  What is J2EE component
Rep) A [...]

OVERVIEW OF SERVLETS »



OVERVIEW OF SERVLETS
Servlets provide a Java based solution used to address the problems currently associated with doing server side programming including inextensible scripting solution, platform specific API’s, and incomplete interfaces.
Servlets are objects that confirm to a specific interface that can be plugged into a Java based server. Servlets are to the server side what applets [...]

Exception Handling and their uses »



Q)  What is the difference between ‘throw’ and ‘throws’ ?And it’s application?

Rep) Exceptions that are thrown by java runtime systems can be handled by Try and catch blocks. With throw exception we can handle the exceptions thrown by the program itself. If a method is capable of causing an exception that it does not
handle, [...]

How to get a Leap Year »



import java.util.Calendar.*;
import java.lang.*;  //its’ a default package which will import
class LeapYear {
public static void main(String args[])throws Exception {
Calendar cal=Calendar.getInstance();
int year=cal.get(Calendar.YEAR);
if(year % 4 == 0 && (year % 100 != 0 || year % 400 == 0))
{   System.out.println(”Leap Year”);          }else  {
System.out.println(”Not a Leap Year);      }
}
}  // The Meaning of above is every 4 year’s the LeapYear [...]