Why do I get an exception called NullPointerException if in Java there is no such concept as a pointer?
Because all the variables(on RHS of assignment) you declare are references to some objects in heap space. If a reference is not pointing any where then on accessing of that variable throws nullpointerexception.