[SOLVED]Whats the Mistake in this if? LOLZ

Discussion in 'Plugin Development' started by MarkusE.s., Oct 14, 2011.

Thread Status:
Not open for further replies.
  1. Offline

    MarkusE.s.

    Whats the Error in this If-Clause
    The Values are the smae, that know I
    Code:
    if (lol.getString(1) == args[0]){
                        p.sendMessage(ChatColor.GREEN+"Dein Account wurde Erfolgreich Aktiviert!");
                        ResultSet gayi = st.executeQuery("UPDATE login Set     IGactiv = 'yes' WHERE username='"+p.getName()+"'");
                        gayi.next();
                        p.sendMessage(gayi.getString(1));
    
                    }else{
                        p.sendMessage(ChatColor.RED+"Dein Account wurde nicht Freigeschaltet!");
                        p.sendMessage("Args"+args[0]);
                    }
     
  2. Offline

    NeatMonster

    You can't do 'string1 == string2' on strings, try 'string1.equals(string2)'.
     
  3. Offline

    Euphi_

    if (lol.getString(1) == args[0]){
    that is for comparing int and booleans
    try this
    if (lol.getString(1).equalsIgnoreCase(args[0])){
     
  4. Offline

    MarkusE.s.

    Works Thanks!!!
     
Thread Status:
Not open for further replies.

Share This Page