This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
Roberto Perillo wrote:Well, I think they just wanted the code to be more readable...
I don't think it has anything to do with readability. But with being able to run your code
Have a look at following code:
Running the server and then the client, results in "Hello Roel" being printed to the console.
When I change the server's code to:
Running the server and then the client, results in a runtime exception:
Exception in thread "main" java.lang.ClassCastException: $Proxy0 cannot be cast to HelloService