Tuesday, 17 September 2013

java client send class and server execute a method from this files

java client send class and server execute a method from this files

Im working on a little project.
My client send a java file :
public class Calc {
public int add(String a, String b){
int x = Integer.parseInt(a);
int y = Integer.parseInt(b);
return x + y;
}
}
My server receive this file in his package. There is no problem for this.
What i want its to excecute 'public int add' in my server with parameter
send by client. For example: my client connects to server. He send
Calc.java and with a String add("1","2") My server receive this and
execute the function to finnaly return the result.
But i dont know how to do this... i just find "execute" but ihavent a main
method in Calc.java
Is this possible to do that ? With what method ?

No comments:

Post a Comment