wood burning stoves 2.0*
The moose likes Beginning Java and the fly likes Recieve value from another method Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Recieve value from another method" Watch "Recieve value from another method" New topic
Author

Recieve value from another method

Pol Appan
Ranch Hand

Joined: Aug 26, 2004
Posts: 144
hello,

I have a method like this



I have another method



How can I recieve value of first method loadUser in my second method?
I do not want to add another parameter to prepareSession method because it is over riding.

How can I achieve this?

Thanks


Never take anything for granted because you never know when you will lose it
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 38016
    
  22
Would it work to make the currentUser variable a field instead?
Pol Appan
Ranch Hand

Joined: Aug 26, 2004
Posts: 144
No didn't work
satishkumar janakiraman
Ranch Hand

Joined: May 03, 2004
Posts: 334
Hi,

I assume your methods are in the same class. Declare the currentUser as an instance variable. eg



bye for now
sat
Pol Appan
Ranch Hand

Joined: Aug 26, 2004
Posts: 144
Ok.


String bn = "myString";



I did like this





In prepareSession I called as this.bn, bn is showing as myString.

My question how to call bn is prepareSession method. I would lik to use bn in prepareSession method.
satishkumar janakiraman
Ranch Hand

Joined: May 03, 2004
Posts: 334
In your method



bye for now
sat
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Recieve value from another method
 
Similar Threads
String reference Value
Illegal modifier for parameter y, only final is permitted
Memory Usage in static Method
Overloading
access one bean from another