aspose file tools*
The moose likes Beginning Java and the fly likes Some queries Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Some queries" Watch "Some queries" New topic
Author

Some queries

Steven Leow
Greenhorn

Joined: Jun 19, 2001
Posts: 6
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

Joined: Feb 06, 2001
Posts: 358
can you give the whole code so that we can understand better?


Cheers,<br />Rani<br />SCJP, SCWCD, SCBCD
Sean MacLean
author
Ranch Hand

Joined: Nov 07, 2000
Posts: 621
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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Some queries
 
Similar Threads
Reg. Applet Chat
How to realize multi-client ?
My way for multi-client failed?
What is the 'host" in the .getByName() method?
java programs in vi editor