Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**NOTE TO JT: This is my class which allows creation of an arbitrary item.
- * This class allows a new item to be defined.
- *
- * @author (your name)
- * @version (a version number or a date)
- */
- public class Item
- {
- // instance variables - replace the example below with your own
- public String name;
- private String itemDescription;
- private boolean isKey;
- /**
- * Constructor for objects of class Items,
- */
- public Item(String name, String itemDescription, boolean isKey)
- {
- // initialise instance variables
- this.name = name;
- this.itemDescription = itemDescription;
- isKey = true;
- }
- /**
- * Returns a dscription of the created item.
- *
- * @param y a sample parameter for a method
- * @return the sum of x and y
- */
- public String getItemDescription()
- {
- return itemDescription;
- }
- /**
- * Returns a dscription of the created item.
- *
- * @param y a sample parameter for a method
- * @return the sum of x and y
- */
- public String getName()
- {
- return this.name;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement