title: can't find why loop don't go inside my condition in my java serrvlet
body: <pre><code>@Override
  protected void service(HttpServletRequest request, HttpServletResponse response)
          throws ServletException, IOException {
      // TODO Auto-generated method stub
      WorldDBManager DB = new WorldDBManager();
      String choices = request.getParameter("selectchoice");
      List&lt;WorlPopulationInfo&gt; country = new ArrayList&lt;&gt;();
  
      country = DB.getResultAsArrayList("world", "select * from country");
  
  
      StringBuffer strB = new StringBuffer();
  
  
      for(int i=0;i&lt;country.size();i++){
          if(country.get(i).countryName == choices){
              strB.append("&lt;option selected='selected'&gt;" + country.get(i).countryName+"&lt;/option&gt;");
              System.out.println(choices + " pareil " + country.get(i).countryName);
          }else if(country.get(i).countryName != choices){
              strB.append("&lt;option&gt;" + country.get(i).countryName+"&lt;/option&gt;");
              System.out.println(choices + " " + country.get(i).countryName);
          }
      }
  
  
      request.setAttribute("country", strB);
  
  
  
  
      getServletContext().getRequestDispatcher("/index.jsp").forward(request,  response);
  
  }
  </code></pre>
  
  <p>i don't understand why he doesnt go to the first if condition  i know the value from variable choices exist inside my database by doing a System.println. i just don't understand why is ignoring my equality. If someone could explain me what im doing wrong. thank.</p>