Skip to main content

Core java

Please note these java.net forums are being decommissioned and use the new and improved forums at https://community.oracle.com/community/java.
1 reply [Last post]
Aamba
Offline
Joined: 2013-03-25

hello,
I am practicing from the book Core Java Volume 1 fundamentals Eight
Edition. on page 124,listing4-2, I wrote two classes EmployeeTest and
Employee in a project name "core java" in Eclipse. I AM not able to run it
Do I need to line the two classes ? How do I link the classes?

AAmba

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
MackSix
Offline
Joined: 2013-03-27

If you have the 2 classes in 2 different java files, they just need to be in the same package and they can "see" each other, otherwise you would have to use an import statement to import Employee into EmployeeTest.

You should probably back up a few steps and learn about packages and imports and compiling using javac on the command line before moving on...