If surname has not been initialized it will benull. You will experience a NullPointerExceptionwhenever you try to call one of surname's methods in thissituation. <br><br>Test first for the null.<br>if (surname!= null) {// do work here}