This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
In this case, the stack trace would have the line with println on it at the top of the trace, because that is where the NullPointerException is thrown. The null reference is not a reference to an object, so there are no methods that can be invoked on it; in particular, the name.length() in the above example is what triggers the NullPointerException here.