Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on May 1st, 2012  |  syntax: None  |  size: 0.65 KB  |  hits: 10  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. public class Sklad {
  2.  
  3.     String[] tabela = new String[20];
  4.  
  5.     public void dajNaSklad(String novNiz) {
  6.         for (int i = 0; i < tabela.length; i++) {
  7.             if (tabela[i] == "") {
  8.                 tabela[i] = novNiz;
  9.                 break;
  10.             }
  11.         }
  12.     }
  13.  
  14.     public boolean prazen() {
  15.         if (tabela.length == 0) {
  16.             return true;
  17.         } else
  18.             return false;
  19.     }
  20.  
  21.     public String vrniIzSklada() {
  22.         String out = "";
  23.         for(int i = tabela.length; i>0; i--){
  24.             if(tabela[i]!=""){
  25.                 out = tabela[i];
  26.             }
  27.         }
  28.         return out;
  29.     }
  30. }