Guest User

Untitled

a guest
Apr 21st, 2018
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 KB | None | 0 0
  1. Can I change this...
  2.  
  3. if (i == CLIENTS)
  4. List l = selectAllClients();
  5.  
  6. for (ListIterator it = l.listIterator(); it.hasNext(); ) {
  7. if (i == CLIENTS) {
  8. Client c = (Client) it.next();
  9. System.out.println(c.getName()+", "+c.getAddress()+", "+c.getPhoneNo());
  10. }
  11. }
  12.  
  13. to this?
  14.  
  15. if (i == CLIENTS)
  16. List l = selectAllClients();
  17.  
  18. for (Object o : l) {
  19. if (i == CLIENTS) {
  20. Client c = (Client) o;
  21. System.out.println(c.getName()+", "+c.getAddress()+", "+c.getPhoneNo());
  22. }
  23. }
Add Comment
Please, Sign In to add comment