java.lang.NoSuchMethodError: method ()V not found

时间:2022-03-15 21:00:22

错误:

java.lang.NoSuchMethodError: Graph: method <init>()V not found

原因:

一般是在函数中构造函数不完整

解决:

构造函数除了有参构造函数还有重写一个无参构造函数。如:

public User(String name,int age){
	this.name = name ;
	this.age = age;
}
public User()	{

}