What is the role of the `stub` in Java RMI?
The `stub` is a piece of code that helps in serializing the parameters of remote method calls.
Thatâ€™s partially correct. While the `stub` does involve serialization, its main role is to forward the method call to the remote object, not just serialize parameters.
Can you explain the entire flow of a remote method call in RMI, including the roles of the `stub` and `skeleton`?