Advertisement
Guest User

little explaination on objects

a guest
Jul 19th, 2018
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.56 KB | None | 0 0
  1. //to create an instance of the general object Item
  2. Item item(itemID, itemName, itemWeight, itemDescription)
  3.  
  4. //to create an instance of the sub-object Weapon
  5. Weapon weapon(itemID,itemName, itemWeight, itemDescription, weaponDmg, weaponDura, weaponAcc, weaponEnchant) extends Item
  6.  
  7. //this same style works for armour and all kinds of other stuff HWOEVER it helps in the long run in terms of sorting as all items created
  8. //using the 'Weapon' can be found using a query for the class 'Weapon' while using 'Item' would return every item as well as all sub-object types
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement