1
I’m creating a fake bank in java but I don’t know how to check if the password has 8 characters.
public void criarSenha(){
String senhacriada = (JOptionPane.showInputDialog("Qual a senha ?"));
if(tamanhodasenhacriada >= 8) { //! O problema está aqui !
System.out.println("Senha criada com sucesso !");
}else {
System.err.println("senha >= 8 !");
}
}
How do I find the size of the string ?
In javascript i do :
if(lenght(senha) >= 8){
// Codigo
}
But in Java I don’t know because I’m starting to learn !
A tip for you who is starting: when you do not know the functioning of some class, I suggest looking for the documentation of the same.
– nullptr
Thanks for the tip @nullptr !
– Vitor Henrique05