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

Define Jar,War,Ear file »



Q) What is EAR file
Rep) Enterprise Archive file. A JAR archive that contains a
J2EE application.
Q) What is JAR file
Rep) Java Archive file it contains a J2EE application.
You can create a JAR file using the command
jar cf XYZ.jar *.class *.gif
if will compress all the .class files and the related gif files to the one file called [...]

Uploading Excel File Using Jsp »



There are two choice for reading and writing the Excel file in your application.
1.By Using the JExcelapi
2.By Jakarta’s Poi.jar which uses the HSSFSheet read and write.
–> Using the JExcelapi which  is  not suitable for the important data. It fails to read several files and  in most occasions it also fails to create cells. In short [...]