searching for a long time, but didn't find any answer on that one:
I have a server and I have a client. The server should receive an object via ObjectInputStream
and ObjectOutputStream
. That already works for any class
, known on the server.
Now I want to send an Object
of a class
the server doesn't know. He only knows the interface of that class. And that obviously fails...
How can I avoid the ClassNotFoundException
? I thought interfaces were the solution. I only want to access the functions I know by the interface, but Java wants to have the class anyway.
Thank you.