我正在为我的 java 类做一个项目,但我不明白为什么会出现这个错误。这是我的代码:
public class address
{
String Street;
String City;
String State;
String Zip;
public address()
{
Street = "";
City = "";
State = "";
Zip = "";
}
public void setStreet(String street)
{
Street = street;
}
public void setCity(String city)
{
City = city;
}
public void setState(String state)
{
State = state;
}
public void setZip(String zip)
{
Zip = zip;
}
public String getStreet()
{
retrun Street;
}
public String getCity()
{
return City;
}
public String getState()
{
return State;
}
public String getZip()
{
return Zip;
}
}
这是每个员工的地址类别。我们刚刚了解了 OOP。这是带有错误的 CMD 输出: