Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Some queries

 
Steven Leow
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I have 2 pieces of code.
1st one : client.java which contains some codes :
... ...
Other o = srv.getOther();
ClientOther co = new ClientOtherImpl();
srv.processServer(co, "Testing");
... ...
2nd one : server.java which has this method
... ...
public void processServer(ClientOther co, String a)
... ...
What is happening here? I mean the process of creating an object called co in client.java and passing it to the processServer method in server.java. Pls advise.
Thanks
 
rani bedi
Ranch Hand
Posts: 358
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
can you give the whole code so that we can understand better?
 
Sean MacLean
author
Ranch Hand
Posts: 621
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well, what's happening right there is that you are passing an instance of the client to the server. Now the server can make calls on public methods in the client, like co.getAddress() or whatever. If this is what you are wondering about, then perhaps an object orient programming tutorial might be helpful. Otherwise, a bit more code for us to examine and a more specific question might do it.
Sean
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic