25 lines
683 B
Java
25 lines
683 B
Java
import com.horstmann.corejava.*;
|
|
// the Employee class is defined in that package
|
|
|
|
import static java.lang.System.*;
|
|
|
|
/**
|
|
* This program demonstrates the use of packages.
|
|
* @version 1.11 2004-02-19
|
|
* @author Cay Horstmann
|
|
*/
|
|
public class PackageTest
|
|
{
|
|
public static void main(String[] args)
|
|
{
|
|
// because of the import statement, we don't have to use
|
|
// com.horstmann.corejava.Employee here
|
|
var harry = new Employee("Harry Hacker", 50000, 1989, 10, 1);
|
|
|
|
harry.raiseSalary(5);
|
|
|
|
// because of the static import statement, we don't have to use System.out here
|
|
out.println("name=" + harry.getName() + ",salary=" + harry.getSalary());
|
|
}
|
|
}
|