Cumprimente pelo nome
Você recebeu o feedback de que os usuários queriam ser cumprimentados pelo nome no app. Vamos adicionar essa funcionalidade ao nosso método personalizado.
Este exercicio faz parte do curso
Java intermediário
Instruções do exercicio
- Dê o tipo correto ao argumento
namedespecificGreeter(). - Use o argumento dentro da string para personalizar a mensagem.
exercicio interativo prático
Tente este exercicio completando este código de exemplo.
class Greeter {
// Give the correct type to the argument of the method
static void specificGreeter(____ name) {
// Call the correct variable given as an argument to the method
System.out.println("Nice day to you, " + ____ + "!");
}
public static void main(String[] args) {
String firstName = "Caleb";
specificGreeter(firstName);
}
}