Java Rest服务和Zip可以搜索

Java Rest服务和Zip可以搜索,java,rest,Java,Rest,您好,我正在尝试使用java在NetBeans上编写一个程序,我必须编写一个REST服务,它接受邮政编码并返回状态。REST服务应该提供路径和查询参数。代码有什么问题 public class Users { private String userId; private String firstName; private String lastName; private String State; private int Zipcode; publ

您好,我正在尝试使用java在NetBeans上编写一个程序,我必须编写一个REST服务,它接受邮政编码并返回状态。REST服务应该提供路径和查询参数。代码有什么问题

   public class Users {

   private String userId;
   private String firstName;
   private String lastName;
   private String State; 
  private int Zipcode;

    public void setUserId(String userId) {
        this.userId = userId;
    }

    public void setFirstName(String firstName) {
        this.firstName = firstName;
    }

    public void setLastName(String lastName) {
        this.lastName = lastName;
    }

    public void setState(String State) {
        this.State = State;
    }

    public void setZipcode(int Zipcode) {
        this.Zipcode = Zipcode;
    }

    public String getUserId() {
        return userId;
    }

    public String getFirstName() {
        return firstName;
    }

    public String getLastName() {
        return lastName;
    }

    public String getState() {
        return State;
    }

    public int getZipcode() {
        return Zipcode;
    }

@Get
@Path("Zipcode")
public String getZipcode (@QueryParam("Zipcode") String Zipcode, @QueryParam("State") String State) {
loadUser();
for (Users u : users) { 
if(getZipcode => 77002 && <= 77099);
JOptionPane.showMessageDialog(null, State);

else if (getZipcode => 77449 && <= 77494);
JOptionPane.showMessageDialog(null, State);

else if (getZipcode => 77502 && <= 77506); 
JOptionPane.showMessageDialog(null, State);

else if (getZipcode => 77550 && <= 77555); 
JOptionPane.showMessageDialog(null, State);

JOptionPane.showMessageDialog(null,"Zipcode is invaild, please try again" );
}
}

你为什么认为这是错误的?你可能也应该解释一下,我没发现有什么问题。用户类中没有错误。else-if语句一直作为错误出现。我检查了else if语句,我觉得它是正确的。Superior或equal是用java编写的>=的。在两个表达式之间还使用了&&运算符:getZipCode>=77550是一个有效的表达式,但是if语句后面通常没有分号。你应该得到一本关于Java基础知识的好书或教程,你还没有很好地理解语法。谢谢。我总是错过一些小细节,试图获得编程方面的额外帮助。