Advertisement
Guest User

Untitled

a guest
Dec 14th, 2019
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.48 KB | None | 0 0
  1. class Osiol{
  2.     private double masa;
  3.     Balon[] balony;
  4.  
  5.     void dodajBalon(Balon balon){
  6.         if(this.balony == null) {
  7.             this.balony = new Balon[1];
  8.             this.balony[0] = balon;
  9.         }else{
  10.             Balon[] tmp = new Balon[this.balony.length+1];
  11.             for(int i = 0; i<this.balony.length; i++)
  12.                 tmp[i] = this.balony[i];
  13.             this.balony = tmp;
  14.             this.balony[this.balony.length - 1] = balon;
  15.         }
  16.     }
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement