RMI: Pass by Value or by Reference?

前端 未结 2 1261
半阙折子戏
半阙折子戏 2021-01-21 06:12

I\'m having trouble finding a clear answer to this question so I thought I\'d ask here with my own specific example:

I am creating a mulitplayer monopoly game. The actua

2条回答
  •  忘掉有多难
    2021-01-21 07:07

    That depends if Bank is an instance of Remote or not. If so, then it will be passed by reference (if all is set up correctly), if not it'll be serialized and passed by value.

    edit: Since your Bank class is not Remote, but is Serializable, then it will be copied and passed by value.

提交回复
热议问题