SHARE
TWEET

Untitled

a guest Apr 18th, 2019 103 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. public static void main(String args[])
  2. {
  3.   String name = null;
  4.   String uppercasedName = null;
  5.  
  6.   try {
  7.     uppercasedName = name.toUpperCase();
  8.   }
  9.   catch(NullPointerException e)
  10.   {
  11.     System.out.println("WARNING: O nome do usuário estava nulo, portanto será tratado como desconhecido.");
  12.     uppercasedName = "DESCONHECIDO";
  13.   }
  14.  
  15.   System.out.println("Seja bem-vindo, " + uppercasedName);
  16. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top