How to Implement class Alkio?
<p>I have following problem to be solved in java: Implement class Alkio. Test with a done main programme AlkioPaa.java with which you see that your class functions.
My answer to this question is following: </p>

<pre><code>/**
* @author A.
* @version 28.11.2011
* Tehtävä5. Ohjelma Toteuttaa luokan Alkio  */

public class Alkio {
  private int rivi;
  private int sarake;
  private int arvo;


   public Alkio(int rivi, int sarake, int arvo){
    int Rivi= rivi;
    int Sarake=sarake;
    int Arvo=arvo;
  }

  public void setAlkio(int rivi, int sarake, int arvo){
    System.out.println("("+rivi+","+sarake+","+arvo+")");
  }

  public int getArvo(){
    return arvo;
  }

  public int getRivi(){
    return rivi;
  }

  public int getSarake(){
    return sarake;
  }

  //jotain häikkää seuraavassa( 28.11.2011). Häikkä poistunut(29.11.2011)
  public String toString(){
    String merkkijono= new String();
    return merkkijono;
  }
}
</code></pre>

<p>Are there any comments?
Then Test is done with main programme AlkioPaa.java which is following: </p>

<pre><code>public class AlkioPaa {

  public static void main(String[] args) {

    Alkio eka = new Alkio(1,2,10);

    System.out.println("Tein alkion, jonka rivi on " + eka.getRivi() 
       + " ja sarake on " + eka.getSarake() + ". Arvo on " + eka.getArvo());


    System.out.println("\n alkio on " + eka.toString());

    String apu = eka.toString();

    System.out.println("alkio " + apu);

    eka.setAlkio(2, 5, 12);

    System.out.println("Muutettu alkio " + eka);
  }
}
</code></pre>

<p>When I run main-program it prints: </p>

<pre><code>Tein alkion, jonka rivi on 0 ja sarake on 0. Arvo on 0
</code></pre>

<p>alkio on
alkio
(2,5,12)
Muutettu alkio
So it does not print (1,2,10) as should be.</p>
