Calling a second class inside the first class in your new package

Hi Folks,

So,  you have created a new Java Package (see my post on Creating your own Java Package in Eclipse) and you have added your first class to the Package (e.g. MyClass.java).

So next, I want to show how to add a second class to your new package and call a method from the second class (SecondClass.java) within the first Class(MyClass.java).

Steps to Follow:

1. Right Click on your package in the Package Explorer in Eclipse.

2. Select New>Class and enter a name for the New class (e.g. SecondClass). Make sure the package showing is your Java Package in the Package TextBox as shown below:

package7

Click finish and your new class will be displayed in the Workbench.