Advertisement
Guest User

Untitled

a guest
Feb 23rd, 2019
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.40 KB | None | 0 0
  1. ArrayList<String> str = new ArrayList<>();
  2. if (str.size()>0)
  3.  
  4. List<String> someStrings = new ArrayList<String>();
  5. ...
  6. if (someStrings.size() > 0) {
  7. System.out.println("First element of list is: " + someStrings.get(0));
  8. } else {
  9. System.out.println("List is empty");
  10. }
  11.  
  12. List<String> str;
  13.  
  14. List<String> str = new Arraylist<String>();
  15.  
  16. str.isEmpty()
  17.  
  18. str.add("hello")
  19.  
  20. str.get(0)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement