null对象调用属性 

e.g

public class Student  {
Integer age;
String name;
String address ;
User user;
}

Student student= new Student(); 


12:student.getUser().getName()


Exception in thread "main" java.lang.NullPointerException
at patterns.builder.Test.main(Test.java:12)

posted on 2023-09-08 23:34  mljqqh  阅读(3)  评论(0编辑  收藏  举报