This may be the first exception one find in his code , Best coding practices will make this exception disappear from your code.
This exception simply say ,that used object is null
String f = null ;
System.out.println("this will cause null pointer exception "+ f.length());
to avoid that always use a null checking
String f = null ;
if(f!==null)
System.out.println("this will cause null pointer exception "+ f.length());