Results 1 to 4 of 4
- 01-26-2010, 07:09 PM #1
Member
- Join Date
- Jan 2010
- Posts
- 10
- Rep Power
- 0
Transfer from one account to another
Hi, I m doing a banking project and I need to make a transfer from one account to another. Example moving 100euros from current to savings.
can anyone explain me few points in java statements of how can i do this.
I am using inheritance i.e having a major class called Acount and 2 other classes (savings and current) inheriting its properties (but the savings account i am setting the interest rate while in curent no interest is given)
thank you
- 01-26-2010, 10:25 PM #2
I think the clone() method in the Object class is what you're looking for.
"Experience is what you get when you don't get what you want" (Dan Stanford)
"Rise and rise again until lambs become lions" (Robin Hood)
-
I'm not so sure about using Clone here. What you are doing is transferring currency from one account to another, not Cloning an Account object. What you need to do here methinks is give accounts addFunds(...) and removeFunds(...) methods. Then if you want to transfer money from savings into checking you would do something like:
Or some such code.Java Code:long amount = 500L; mySavings.removeFunds(amount); myCheckingAcct.addFunds(amount);
Last edited by Fubarable; 01-26-2010 at 10:44 PM.
- 01-26-2010, 10:43 PM #4
Similar Threads
-
Search Array for Account Number Link
By Ryujin89 in forum Reviews / AdvertisingReplies: 0Last Post: 11-02-2009, 08:45 AM -
Folder Creation On Shared Hosting Account
By arpitgadle in forum Java ServletReplies: 2Last Post: 10-03-2009, 02:04 PM -
validating account
By ServletEst in forum Java ServletReplies: 3Last Post: 08-24-2009, 01:11 PM -
Using java to access internet account
By elgem in forum Advanced JavaReplies: 3Last Post: 01-18-2009, 06:49 PM -
Account mix problem
By nihongbin in forum Threads and SynchronizationReplies: 3Last Post: 12-10-2008, 05:05 AM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks