我对 POJO 有疑问。
看下面的例子
public class User
{
String user="";
String password="";
String firstName="";
String lastName="";
ChallengeQuestions challengeQuestions;
//getter and setters for these prooperties
}
public class ChallengeQuestions
{
String question="";
String answer="";
//getter and setters for these properties
}
这是我的问题,User
类是否是 POJO。
谢谢,
纳兰德拉
最佳答案
POJO,即普通旧 Java 对象,是指所有用户定义的类型,这些类型不必扩展特定/特殊的预先指定类或专门的预先指定接口(interface)。
您的类属于此类别,因此它是 POJO。
关于java - 这个类是POJO吗,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4601521/