my dog learned polymorphism
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
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Some queries" Watch "Some queries" New topic

Some queries

Steven Leow

Joined: Jun 19, 2001
Posts: 6
I have 2 pieces of code.
1st one : which contains some codes :
... ...
Other o = srv.getOther();
ClientOther co = new ClientOtherImpl();
srv.processServer(co, "Testing");
... ...
2nd one : 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 and passing it to the processServer method in Pls advise.
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
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.
I agree. Here's the link:
subject: Some queries
jQuery in Action, 3rd edition