Advertisement
Guest User

Untitled

a guest
Mar 20th, 2018
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.39 KB | None | 0 0
  1. package Wyklad2_Interface;
  2.  
  3. public class Tablica {
  4.     Object tablica[];
  5.     int rozmiar;
  6.     int wypelnienie;
  7.    
  8.     public Tablica(){
  9.         this.rozmiar = 1;
  10.         this.wypelnienie = 0;
  11.         tablica = new Object[this.rozmiar];
  12.     }
  13.    
  14.     public void dodaj(Object obj){
  15.         if(wypelnienie == rozmiar)
  16.             System.out.println("Tablica pelna");
  17.         else{
  18.             tablica[wypelnienie] = obj;
  19.             wypelnienie++;
  20.         }
  21.     }
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement