开发者

I'm having an issue with the following code and haven't been able to debug it

开发者 https://www.devze.com 2023-03-25 07:37 出处:网络
Error says something about eZip not being recognized or something public class Address { private String name;

Error says something about eZip not being recognized or something

public class Address
{     
   private String name;
   private String street;
   private String city;
   private String state;
   private String zip;

   public开发者_开发问答 Address(String aName, String aStreet,
         String aCity, String aState, String aZip)
   {  
      name = aName;
      street = aStreet;
      city = aCity;
      state = aState;
      zip = eZip;
   } 
}


um, perhaps it is because the parameter you gave is called aZip and eZip is not something you've made anywhere else I'm assuming.


You're declaring the constructor parameter

...String **aZip**)

And then referencing at the bottom of your constructor

zip = **eZip**; 

You just misstyped, that's all.

0

精彩评论

暂无评论...
验证码 换一张
取 消