Difference between throw and throws November 21, 2006
Posted by :) in JAVA.trackback
The throw keyword denotes a statement that causes an exception to be initiated. It takes the Exception object to be thrown as argument. The exception will be caught by an immediately encompassing try-catch construction or propagated further up the calling hierarchy.
The throws keyword is a modifier of a method that designates that exceptions may come out of the method, either by virtue of the method throwing the exception itself or because it fails to catch such exceptions that a method it calls may throw.


first thank yiou for your useful blog
secon i have aproblem and wish to help me..
sorry to post thi problem here but i don’t knoe how to reach you
anyway
i tried to parse adate in format –>dd/mm/yy
but i get an unexpected result can you tell me why?
SimpleDateFormat df=new SimpleDateFormat(“dd/MM/yy”);
df.parse(“02/10/06″)
System.out.print(df.parse(“02/10/06″));
//the result will be
Mon Oct 02 00:00:00 GMT+04:00 2006
while i expect
02/10/06
what’s the problem
Hi try this…………..
DateFormat formatter = new SimpleDateFormat(“dd/MM/yy”);
Date date = (Date)formatter.parse(“24/11/06″);
String s = formatter.format(date);
System.out.println(s);
thank you for reply
i knoe this is work but yu convert the date to string
but i need to convert string 24/11/.06
to date 24/11/06
because i have another sysytem and need to set it’s date
for example
mysystem.setdate(date);
thank you the problem has been solved
but i need afavour from you
i have blog @wordpress.com
and i need to add acounter like yours at my blog to count the visitors
i alraedy have the counter and know how to use it
in blogspot.com
i was adding the url of the counter
in html code of trhe blog
but in wordpress.com
i don’t know where to find html of the blog design can you guide me
Best Regards,
essam abdelaziz
diferrence between throws ,throw and throwable
document.location.href=’http://www.google.com’
hi i m sending u one file everything is working fine with this . But i want where ever date 00.00.0000 comes there should come a null.plz help me out.
public class sqlldrColFormat {
public static String get( String colName, destDataType) {
String format = “YYYYMMDD”;
if (“TIMESTAMP”.equals(destDataType)) {
return ” Timestamp(8) ” + (char)34 + “YYYYMMDD” + (char)34;
} else if (“DATE”.equals(destDataType)) {
return ” DATE ” + (char)34 + “YYYYMMDD” + (char)34;
} else {
return “”;
}
}
}
hello
Nice blog..But can u give me one example with explanation of throw and throws…