在主函数中怎么写才能输出User中的值,
自己写的永远都是输出com.exam.bean.User@27f8302d。看不见值?
```public User getUser(String grade) throws ClassNotFoundException, SQLException{
con=MysqlHelper.conn();
User user=new User();
String sql="select * from user where grade=?";
stmt=(PreparedStatement) con.prepareStatement(sql);
stmt.setString(1, grade);
rs=stmt.executeQuery();
if(rs.next()){
user.setId(rs.getInt(1));
user.setUsername(rs.getString(2));
user.setName(rs.getString(3));
user.setCode(rs.getString(4));
user.setGrade(rs.getString(5));
}
rs.close();
stmt.close();
con.close();
return user;
}
public static void main(String[] args) throws SQLException, ClassNotFoundException, IOException {
System.out.println();
}