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

infantry1

By: ace on May 26th, 2010  |  syntax: None  |  size: 0.86 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 Infantry here.
  4.  *
  5.  * @author (your name)
  6.  * @version (a version number or a date)
  7.  */
  8. public class Infantry
  9. {
  10.     // instance variables - replace the example below with your own
  11.    int position;
  12.  
  13.     /**
  14.      * Constructor for objects of class Infantry
  15.      */
  16.     public Infantry()
  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.     public void setPosition(int postition)
  29.     {
  30.         this.position = position;
  31.     }
  32.    
  33.     public int getPosition()
  34.     {
  35.        
  36.         return position;
  37.     }
  38.    
  39.    public void move()
  40.    {
  41.        this.position = getPosition()+2;
  42.     }
  43. }