"impl.GreetingClientImpl" should appear in the diagram.
We'll next begin defining methods.
Right click on the Greeting and select New - Method.
Enter greet as the name and to select String as the Return type, select the pull-down button.
Confirm that "String" is selected as the "Return type". Select the OK.
"greet()" should appear under the "Greeting".
In a similar manner, we'll add method "execute" to the "GreetingClient" interface.
Right click on the "GreetingClient" interface and select Newe - Method from the context menu.
Enter execute as the "Name" and select void as the "Return type". Select the OK button.
"execute()" should appear under the "GreetingClient".
Note that there will be some error messages because implementations of the interfaces do not definitions of methods we just defined. We will correct these errors next.
I personally prefer to define all interfaces and classes before defining methods and attributes, but if we defined methods of interfaces before creating classes, methods defined in an interfaces will automatically be added to the class when it is defined.
Right click on the impl.GreetingImpl class and select on New - Method in the context menu.
Enter greet as the "Name" and select String as the "Return type". These have to match what we defined in the "Greeting" interface.
Select the OK button.
In a similar manner, defined method "execute" for the "impl.GreetingClientImpl" class.
Right click on impl.GreetingClientImpl and select New - Method in the context menu.
Enter execute in the "Name" and select void as the "Return type". Select the OK button.
We'll next define attribute "greeting" which will hold the greeting string to output.
Right click again on impl.GreetingClientImpl and select New - Attribute in the context menu.
Enter greeting as the "Name". Verify that Use accessors is checked. Select the Browse... to select the "Type".
Select Greeting - examples1 from the list. If it is not in the list, enter Greeting in the "Select the type of this attribute" and select it when the list appears.
Select the OK button.
Confirm that "Type" is "examples1.Greeting" and select the OK button.
"greeting: Greeting" should now appear.
We'll now begin adding codes to the classes.
Double click on the "impl.GreetingImpl" class.
Make sure "GreetingImpl.java" tab is selected. Generated codes for the "impl.GretingImpl" class should show. Move down to the "public String greet()" method and enter return "UML Hello World1"; as below. Save the change by selecting the save icon in the Eclipse icon menu.
We'll next add code to the "execute()" method.
Double click on the "impl.GreetingClientImpl" box. Find the "public void execute()" method. Enter System.out.println(greeting.greet());.
We'll now create the final class - the class that contains "main()".
Select the and drag the mouse to create a rectangle.