怎么调用接口中类(对象)的参数,并赋值?
有实体类Student接口IStudentDao实现类StudentImplpublicinterfaseIStudentDao{publicintsave(Studen...
有实体类Student
接口IStudentDao
实现类StudentImpl
public interfase IStudentDao {
public int save(Student s);
}
怎么在测试类main方法中调用save并给它赋值 展开
接口IStudentDao
实现类StudentImpl
public interfase IStudentDao {
public int save(Student s);
}
怎么在测试类main方法中调用save并给它赋值 展开
1个回答
2018-07-06 · 国内最优秀java资源共享平台
关注
展开全部
案例演示
public static void main(String[] args) {
IStudentDao iStudentDao =new StudentImpl();
Student s=new Student("zs","123");
iStudentDao.save(s);
}
public static void main(String[] args) {
IStudentDao iStudentDao =new StudentImpl();
Student s=new Student("zs","123");
iStudentDao.save(s);
}
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询