Re: To get reference to already existing object from another object




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.





.



Relevant Pages

  • Re: ssh-agent Warnings ???
    ... error messages as a group any time I open a new Xterm. ... Could not open a connection to your authentication agent. ... It doesn't matter whether the xterm I open is on my local desktop, ... That could have done more damage than helped as if you changed keys they are ...
    (comp.os.linux.security)
  • Re: To get reference to already existing object from another object
    ... methods of the agent class from the controller class.Please send me ... spelled Agent and I'll assume you misspelled the Controller class as well. ... "Foo" and "Bar", respectively. ...
    (comp.lang.java.help)
  • Re: How to return an empty aggregate
    ... Adapters and Relays never found anything that is empty. ... -- Generic Agent Interface ... mentioned by splitting the Entity stream context into separate item. ... Consider a logging system that is designed with OO in mind. ...
    (comp.lang.ada)
  • Re: Closer Clemens ???
    ... know little context, or where it started, other than that Roger's agent ... said flat out NO (Which has to be taken with a grain of salt on it's ... despite what they were claiming in September. ...
    (alt.sports.baseball.bos-redsox)
  • Closer Clemens ???
    ... I didn't see this story on NESN last night heard it second hand, ... know little context, or where it started, other than that Roger's agent ...
    (alt.sports.baseball.bos-redsox)