NullPointer Exception while passing just filename ...... 1. Create a SafeFile instance without path. 2. SafeFile file = new SafeFile("hello.txt") 3. NullPointerException is thrown.