android--------解决Entities and POJOs must have a usable public constructor

卧疾丰暇豫,翰墨时间作。这篇文章主要讲述android--------解决Entities and POJOs must have a usable public constructor相关的知识,希望能为你提供帮助。
今天在学习android数据库,运行程序的时候报错,错误是:Entities and POJOs must have a usable public constructor. You can have an empty constructor or a constructor whose parameters match the fields (by name and type).Tried the following constructors but they failed to match:
Word(java.lang.String,java.lang.String) -> [param:english_word -> matched field:unmatched, param:chinese_meaning -> matched field:unmatched]。
【android--------解决Entities and POJOs must have a usable public constructor】解决方法:在实体类写一个空的构造函数即可。
因为我有一个有参的构造函数,于是我写了一个空的构造函数即可运行。

android--------解决Entities and POJOs must have a usable public constructor

文章图片

 

  写一个空的构造函数:
android--------解决Entities and POJOs must have a usable public constructor

文章图片
 
 
 
 
 
运行成功:
 
android--------解决Entities and POJOs must have a usable public constructor

文章图片

 

 

    推荐阅读