I don't want to use try block to catch the exception I just want to check null with if condition.when i try that it is giving me the null pointer exception.
public class test {
    public static void main(String[] args) {
       String name=null;
       if(name.equals(null)){
          System.out.println("null");
       }
       System.out.println("done");
    }
}
 
     
    