Programming Tutorials Browser Tutorials Articles Struts Tutorials Hibernate Tutorials

  Tutorial: Programming: Kingdom - Buy Land

To the Kingdom class (see Kingdom), add a method called buyLand.

Tutorial Details:

To the Kingdom class (see Kingdom), add a method called buyLand, which takes one parameter which is the amount of land to buy. This method will decrease the amount of stored grain by the amount needed to buy the land, and increase the amount of land.

A constant, SEED_REQUIRED_PER_ACRE, defines how much grain it takes to buy one acre of land.

Design decisions. You must decide exactly how to declare this method (public?, private?, static?, void?, double?, etc).


 

Rate Tutorial:
http://www.roseindia.net/java/java-tips/oop/q-hammurabi/q-pr-hammurabi-buyLand.shtml

Read Tutorial at: Click here to view the tutorial

Rate Tutorial:
Programming: Kingdom - Buy Land

View Tutorial:
Programming: Kingdom - Buy Land

Related Tutorials:

Build your own caching mechanisms with volatile collections - JavaWorld June 1999
Build your own caching mechanisms with volatile collections - JavaWorld June 1999
 
Object mobility in the Jini environment - JavaWorld January 2001
Object mobility in the Jini environment - JavaWorld January 2001
 
Design patterns make for better J2EE apps
Design patterns make for better J2EE apps
 
Site navigation
 

 

Send your comments, Suggestions or Queries regarding this site at roseindia_net@yahoo.com.

Copyright © 2006. All rights reserved.