[[pole]]
 

http://kmlinux/~culik/wiki

    private void send (String s)
    {
        jTextArea1.append (s + "\n");
    }
 
    private void send (String id, int [] p)
    {
        if (p == null)
        {
           send (id + " je null");
        }
        else
        {
           /*
           send (id + " ma " + p.length + " prvku");
           for (int i = 0; i < p.length ; i ++)
              send (id + "[" + i + "] = " + p[i]);
           */
 
           String txt = id + " = (";
           for (int i = 0; i < p.length ; i ++)
           {
               if (i > 0) txt += ", ";
               txt += p[i];
           }
           txt += ")";
           send (txt);
        }
    }
 
    private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {
        int [] a = new int [3];
        for (int i = 0; i < a.length; i++)
            a[i] = i * i;
 
        int [] t = new int [a.length + 1];
        for (int i = 0; i < a.length; i++)
            t [i] = a [i];
 
        send ("Pole a", a);
        send ("Pole t", t);
 
        a = t;
 
        send ("Pole a", a);
        send ("Pole t", t);
 
        int [] z = new int [0];
        send ("Pole z", z);
 
        int [] e = null;
        send ("Pole e", e);
 
    }
 
pole.txt · Last modified: 2011/10/10 16:30 by 147.32.8.115
 
Recent changes RSS feed Creative Commons License Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki