try
{
something;
}
Catch(SomeException e)
{
if(e==null)
do this ;
else
do that;
}
My question is can there be anytime ,any Exception object null???? Before extracting data from Exception object Should we check for Null???
-
Try/Catch (7 messages)
- Posted by: Monami Sharma
- Posted on: December 24 2004 05:00 EST
Threaded Messages (7)
- Try/Catch by Nestor Boscan on December 27 2004 00:16 EST
- Try/Catch by Martin Straus on December 28 2004 14:05 EST
- Try/Catch by Martin Straus on December 28 2004 14:07 EST
- Try/Catch by Monami Sharma on December 30 2004 00:21 EST
-
Try/Catch by Martin Straus on December 30 2004 01:47 EST
-
Try/Catch by Parag Desai on January 01 2005 01:31 EST
- Try/Catch by Martin Straus on January 03 2005 08:19 EST
-
Try/Catch by Parag Desai on January 01 2005 01:31 EST
-
Try/Catch by Martin Straus on December 30 2004 01:47 EST
- Try/Catch by Monami Sharma on December 30 2004 00:21 EST
-
Try/Catch[ Go to top ]
- Posted by: Nestor Boscan
- Posted on: December 27 2004 00:16 EST
- in response to Monami Sharma
Hi
The java language will always pass the exception that was instantiated in the throw statement that raised the exception. So you don't have to check if the exception object is null. -
Try/Catch[ Go to top ]
- Posted by: Martin Straus
- Posted on: December 28 2004 14:05 EST
- in response to Monami Sharma
Even if I was new to Java, it would make no sense to me. A null exception would mean nothing was thrown... so there's nothing to catch ;)
Regards,
Martin -
Try/Catch[ Go to top ]
- Posted by: Martin Straus
- Posted on: December 28 2004 14:07 EST
- in response to Monami Sharma
One last thing... try not to post this kind of questions in the J2EE forum, please... -
Try/Catch[ Go to top ]
- Posted by: Monami Sharma
- Posted on: December 30 2004 00:21 EST
- in response to Martin Straus
Thanks for confirmation. When u see this kind of things in some existing framework which is being used in some vast and live system its neccessary to take suggestions from experts so i did the same by posting the question.Otherwise my views were also the same so please dont mind it because those people who wrote that framwork were experts/experienced programmer so no harm in giving thoughts or raising why. -
Try/Catch[ Go to top ]
- Posted by: Martin Straus
- Posted on: December 30 2004 13:47 EST
- in response to Monami Sharma
There're a lot of Java experts' forums out there... -
Try/Catch[ Go to top ]
- Posted by: Parag Desai
- Posted on: January 01 2005 01:31 EST
- in response to Martin Straus
Hi... I'm curious to know which framework this code has been picked from. Hope it's not Struts or Maverick, coz I hold them in high esteem.
-Parag -
Try/Catch[ Go to top ]
- Posted by: Martin Straus
- Posted on: January 03 2005 08:19 EST
- in response to Parag Desai
Yeah, I'd like to know that too. JBoss, perhaps? ;)