yes,manikandan v,I think you are right.
the operater "||" will cause short circuit,only the left pression is false,the right pression will caculate. so
4 if ((s ==null) || ( i =s.length()))
if (s == null) is false, that means s != null, it can't throw exception.otherwise, the right pression cann't be caculate.
But as concerning 3if ((s !=null) || ( i =s.length()))
if (s!= null) is false, that means (s == null),and the pression (i = s.length) will throw nullPointerException.