Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * Write a description of class Calvary here.
- *
- * @author (your name)
- * @version (a version number or a date)
- */
- public class Calvary
- {
- // instance variables - replace the example below with your own
- int position;
- /**
- * Constructor for objects of class Calvary
- */
- public Calvary()
- {
- // initialise instance variables
- position = this.position;
- }
- /**
- * An example of a method - replace this comment with your own
- *
- * @param y a sample parameter for a method
- * @return the sum of x and y
- */
- public void setPosition(int position)
- {
- this.position = position;
- }
- public int getPosition()
- {
- return position;
- }
- public void move()
- {
- this.position = getPosition()+3;
- }
- }
Add Comment
Please, Sign In to add comment