Welcome to Abdul Malik Ikhsan's Blog

JSP vs PHP Exception

Posted in Tutorial JSP, Tutorial PHP by samsonasik on February 2, 2008

PHP :

Code:
<?
try{
if (!@$x=10/0){ throw new Exception(“salah logika…”);}
}catch(Exception $e){
print $e->getMessage();
}
?>


JSP :

Code:
<%
try{
int x=10/0;
}catch(Exception e){
out.print(“salah logika…”);
}
%>

Advertisements

2 Responses

Subscribe to comments with RSS.

  1. tia said, on March 1, 2008 at 6:15 am

    lha kode itu fungsinya untuk apa

  2. samsonasik said, on March 1, 2008 at 7:05 am

    untuk penanganan error / error handling.


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: