| Author |
Trouble calling this method
|
Mark Captain
Ranch Hand
Joined: Nov 01, 2011
Posts: 30
|
|
I am having trouble using this method
Main driver
How do i use the first method?
choice = out.printClosingMessage(???);
|
 |
D. Ogranos
Ranch Hand
Joined: Feb 02, 2009
Posts: 214
|
|
If your method requires an object as parameter, you either need to create the object, or get it from some other method. Like:
Did that answer your question?
Ohh and please, use the code tag (above the edit window) to make code samples easier to read.
|
 |
Mark Captain
Ranch Hand
Joined: Nov 01, 2011
Posts: 30
|
|
Fixed that problem but now I am getting a dead code? error
|
 |
Nomaan Butt
Ranch Hand
Joined: Oct 19, 2011
Posts: 54
|
|
this statement is incorrect, you need to call handleLogin() method of LoginHandler class through its instance
|
 |
Campbell Ritchie
Sheriff
Joined: Oct 13, 2005
Posts: 32830
|
|
Mark Captain wrote: . . .
How do i use the first method? . . .
As far as I am concerned, you don’t. A class should be responsible for itself, so the printClosingMessage should be part of the account class. You would call it like this
account123.printClosingMessage();
or like this
account456.printClosingMessage(out);
depending whether you want to pass it a reference to an Output object or not.
Please avoid coloured text; many people find it difficult to read.
|
 |
Mark Captain
Ranch Hand
Joined: Nov 01, 2011
Posts: 30
|
|
Thanks all for the help tonight, could not have done it with out you!
Everything is working fine =]
|
 |
Campbell Ritchie
Sheriff
Joined: Oct 13, 2005
Posts: 32830
|
|
You’re welcome and well done sorting it out.
|
 |
 |
|
|
subject: Trouble calling this method
|
|
|