Advertisement
Guest User

Untitled

a guest
Nov 19th, 2019
111
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.69 KB | None | 0 0
  1. package lotnisko;
  2.  
  3. import java.util.concurrent.atomic.AtomicInteger;
  4.  
  5. public class Plane {
  6. private static AtomicInteger generator = new AtomicInteger(0);
  7. private final int planeId;
  8. private int departureTime;
  9.  
  10. public Plane() {
  11. this.planeId = generator.incrementAndGet();
  12. }
  13.  
  14. @Override
  15. public String toString() {
  16. return "Plane{" +
  17. "planeId=" + planeId +
  18. '}';
  19. }
  20.  
  21. public int getPlaneId() {
  22. return planeId;
  23. }
  24.  
  25. public int getDepartureTime() {
  26. return departureTime;
  27. }
  28.  
  29. public void setDepartureTime(int departureTime) {
  30. this.departureTime = departureTime;
  31. }
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement