Guest User

Untitled

a guest
Aug 19th, 2018
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.69 KB | None | 0 0
  1. Java class variable number
  2. Driver d1 = new Driver("John", "01/01/1980");
  3.  
  4. List<Driver> drivers = new ArrayList<Driver>();
  5. drivers.add(new Driver(..));
  6. drivers.add(new Driver(..));
  7.  
  8. ArrayList<Driver> drivers = new ArrayList<Driver>();
  9.  
  10. Driver d1 = new Driver("John", "01/01/1980");
  11. drivers.add(d1);
  12.  
  13. Driver[] drivers = {new Driver("John", "01/01/1980"),
  14. new Driver("Smith", "02/02/1990")};
  15.  
  16. // or
  17.  
  18. Driver[] drivers = new Driver[2];
  19. drivers[0] = new Driver("John", "01/01/1980");
  20. drivers[1] = new Driver("Smith", "02/02/1990");
  21.  
  22. List<Driver> drivers = new ArrayList<Driver>();
  23. drivers.add(new Driver("John", "01/01/1980"));
  24. drivers.add(new Driver("Smith", "02/02/1990"));
  25. // ...
Add Comment
Please, Sign In to add comment