- public long add(String name,String number){
- SQLiteDatabase db=helper.getWritableDatabase();
- ContentValues values=new ContentValues();
- values.put("name",name);
- values.put("number", number);
- long id=db.insert("person",null,values);
- db.close();
- return id;
复制代码
代码和张老师视频了的一样,为什么会在add()和return id上报错呀!
add()的错误为
Multiple markers at this line
- Illegal modifier for parameter add; only final is
permitted
- Syntax error on token ",", ; expected
- Syntax error on token ")", ; expected
return id;的错误为
Void methods cannot return a value
我明明定义的是long 不是viod呀!
求大神解答一下,谢谢! |
|