Ans. Either you need to catch the exception by using try catch block or you need to check whether the object is null wherever you think the object can be null.
Option 1:
try{
-----code-----
}catch(Exception e){
}
Option 2:
if(obj != null){
-----do the needful-----
}
Posted on Nov 06, 2012 by Arindam
Ans. Either you need to catch the exception by using try catch block or you need to check whether the object is null wherever you think the object can be null.
Option 1:
try{
-----code-----
}catch(Exception e){
}
Option 2:
if(obj != null){
-----do the needful-----
}