NullPointerException , null, . , , JVM , null, , -.
, :
String tmp = myObj.getSomething();
String result = tmp.substring(1);
1- NullPointerException ( , , , myObj.getSomething()), , myObj null. 2- NullPointerException, , tmp null, .. myObj.getSomething() null. , myObj.getSomething() null , if (tmp != null) { ... } else { ... } .