Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static void main(String args[])
- {
- String name = null;
- String uppercasedName = null;
- try {
- uppercasedName = name.toUpperCase();
- }
- catch(NullPointerException e)
- {
- System.out.println("WARNING: O nome do usuário estava nulo, portanto será tratado como desconhecido.");
- uppercasedName = "DESCONHECIDO";
- }
- System.out.println("Seja bem-vindo, " + uppercasedName);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement