Why does Java frequently throw null pointer exception if I try to access null values while Objective C does not?
Java:
public class SubscribeEmailActivity {
String status;
public static void main(String[] args){
if(Status.equals(null)||status.equals(""){
// i am getting error here
}
}
}
Objective C:
//in .h file
NSString *exp;
//in .m file
if ([exp isEqualToString:NULL] ||[exp isEqualToString:@""])
{
// i am not getting any error
}