Re: To get reference to already existing object from another object
- From: "Hal Rosser" <hmrosser@xxxxxxxxxxxxx>
- Date: Fri, 30 Nov 2007 15:01:46 -0500
there is one class called agent class. there are methods and
attributes in that class. there is another class called controller
which is in the same context. i need to access the attributes and
methods of the agent class from the controller class.Please send me
pointers on this. It would be great if any one could respond.
First I'll assume you misspelled the agent class here and that it is really
spelled Agent and I'll assume you misspelled the Controller class as well.
In the main (or other method) in the Controller class you may need to enter
some code similar to this:
//create an Agent object
Agent myAgent = new Agent();
//then call the method like this
myAgent.methodName();
It would be great if you provided the code you're working with, and show us
what you've tried and what error messages you may have received.
.
- References:
- Prev by Date: Math/Programming Algorithm Help
- Next by Date: Re: wait and spurious wakeups
- Previous by thread: To get reference to already existing object from another object
- Next by thread: Math/Programming Algorithm Help
- Index(es):
Relevant Pages
|