Java自我学习路线
一、使用反射调用方法
- 四关键
对象
方法名
实参列表
返回值
public class User {
public int id;
private String name;
String address;
protected int sno;
public User() {
}
public User(int id, String name, String address, int sno) {
super();
this.id = id;
this.name = name;
this.address = address;
this.sno = sno;
}
public void study() {
System.out.println("study...");
}
public void eat(int a,String b) {
System.out.println("eat...");
}
@Override
public String toString() {