By Ramakrishna on Apr 6, 2009 in Java Interview Questions | 0 Comments
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, [...]
By Ramakrishna on Apr 5, 2009 in Java Interview Questions | 0 Comments
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 [...]
By Ramakrishna on Apr 4, 2009 in Define creating and extracting of jar | 0 Comments
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 [...]
By Ramakrishna on Feb 9, 2009 in Upload Excel sheet using jsp/java | 0 Comments
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 [...]