Advertisement
Guest User

Untitled

a guest
Mar 31st, 2015
280
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.32 KB | None | 0 0
  1. List<Object> list;
  2. //Here the list is NULL
  3.  
  4. list = new ArrayList();
  5. //Here the list is no longer NULL, but list.isEmpty() will return true, because there are no variables added to the list
  6.  
  7. list.add(new Object());
  8. //Here the list is not NULL, and list.isEmpty() will return false, because there is a 'new Object()' added
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement