Pastebin launched a little side project called HostCabi.net, check it out ;-)Don't like ads? PRO users don't see any ads ;-)
Guest

tank1

By: ace on May 26th, 2010  |  syntax: None  |  size: 0.87 KB  |  hits: 23  |  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.  
  2. /**
  3.  * Write a description of class Tanks here.
  4.  *
  5.  * @author (your name)
  6.  * @version (a version number or a date)
  7.  */
  8. public class Tank
  9. {
  10.     // instance variables - replace the example below with your own
  11.   int position;
  12.  
  13.     /**
  14.      * Constructor for objects of class Tanks
  15.      */
  16.     public Tank()
  17.     {
  18.         // initialise instance variables
  19.     position = this.position;
  20.     }
  21.  
  22.     /**
  23.      * An example of a method - replace this comment with your own
  24.      *
  25.      * @param  y   a sample parameter for a method
  26.      * @return     the sum of x and y
  27.      */
  28.    
  29.    public void setPosition(int position)
  30.     {
  31.        this.position = position;
  32.     }
  33.    
  34.    public int getPosition()
  35.    {
  36.        position = position+1;
  37.         return position;
  38.     }
  39.    
  40.     public void move()
  41.     {
  42.         this.position = getPosition()+2;
  43.     }
  44. }