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.
... all the possible mecahnisms to share objects in a standalone java application.
I doubt that they've all been tried. All objects are unique (one of the core principles of Object Orientation) and can be shared among any other object in a variety of ways. They can be passed as parameters in methods, they can be returned from methods, they can be referenced directly as fields, they can be members of collections, etc. The thing to remember in Java though is that objects can only be accessed by a reference. Objects can become orphaned when there are no longer any reference that refer to them. When that happens they become subject to garbage collection. Michael Morris [ March 20, 2003: Message edited by: Michael Morris ]
Any intelligent fool can make things bigger, more complex, and more violent. It takes a touch of genius - and a lot of courage - to move in the opposite direction. - Ernst F. Schumacher
I heard about storing the objects in persistent storage like files etc. When would that be used in a standalone java application ?
Whenever you need to store and retreive the state of the object. For example, your program monitors the stock market activity during the trading day. After the trading day, you can close your app. When you restart it the next day, your program will restore its state and resume execution. Eugene.