Most object-oriented applications do not allow other objects to access their fields directly by declaring them private. Then they make their methods protected, public, or package as needed and allow other objects to manipulate their private data by calling the methods only. Program Improvements Program improvements for this lesson include setting the correct access levels and organizing a program into functional units. It is always best to restrict access as much as possible. At that time, no access level was specified for the other classes and fields so they are all package by default.
All methods have an access level of public .
Here are possible solutions for the RMIClient1.java and RMIClient2.java client programs. If not, make it private , run the javac command to compile, and see what the compiler has to say about it. Organizing Code into Functional Units One way to divide code into functional units is to put the user interface code in one class and the code that responds to user interface interactions in another class. Internationalization , take the RMIClient1.java program and move the actionPerformed method to its own class. The RMIClient1 class will become two classes.