Constructor name should be same as your class name. your class name is Rectangle1
thus your Constructor name
should be the same as well, currently java compiler this it as an method without a return type, thus it complains.
public Rectangle(double width, double height){
should be
public Rectangle1(double width, double height){
6
solved Invalid method declaration, return type required