Advertisement
Guest User

Untitled

a guest
Apr 25th, 2019
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.87 KB | None | 0 0
  1. class RentalThing{
  2.     public RentalThing(){
  3.         Renter rn = new Renter();
  4.         ar.add(rn);
  5.     }
  6.  
  7. }
  8.  
  9. class Renter{
  10.     ArrayList containers = new ArrayList()<>
  11.    
  12.     public Renter(){
  13.         generateContainters();
  14.     }
  15.  
  16.     public ArrayList<Containers> generateContainters(){
  17.         for(int i =0; i<3; i++){
  18.             Containers c = new Containers(i);
  19.             containers.add(c);
  20.         }
  21.     }
  22.  
  23.     pubilic Containers getContainerWParameters(int param){
  24.         return getContainterNumber(param);
  25.     }
  26.  
  27.     pubilic Containers getContainterNumber(int containerNumber){
  28.         for(Containers co : containers){
  29.             if(co.number == containerNumber){
  30.                 return co;
  31.             }
  32.         }
  33.     }
  34. }
  35.  
  36. class Containers{
  37.     public int number;
  38.     public Containers(int number){
  39.         this.number = number;
  40.     }
  41. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement