samedi 31 octobre 2015

If statement does equalsIgnoreCase while not preffered - Java

If I use this code:

if(new File(inputNickname + ".acc").exists() == false) {
        System.out.println("[Login] This account does not exists!");
        exists = false;
    }

and I would make a text file called example.acc, it will say true if inputNickname = EXAMPLE or ExAmPle etc. But I only want that exists = true, when inputNickname is example and not EXAMPLE or ExAmPlE etc.

Thanks

Aucun commentaire:

Enregistrer un commentaire