I have a boring day to read something

xiaoxiao2021-03-06  39

boring day.

Changed the lower glasses and repaired the teeth. Other no more

After reading the book, I saw the next novel.

Here is some things I have found in Baidu to see it.

However, I am still very interesting to see the book in the bookstore.

Have the opportunity to buy the book.

It is a pity that there is no money in his hand. As long as 20 yuan.

God, the world is living like I am a miserable person?

I am learning Java2 core technology i's fourth chapter according to the Employee class code written in the book.

Import corejava. *;

Class Employee

{

PRIVATE STRING NAME;

PRIVATE DOUBLE SALY;

PRIVATE TOE HIREDAY;

Public Employee (String N, Double S, Day D)

{

Name = n;

Salary = S;

Hireday = d;

}

Public void print ()

{

System.out.println (Name " SALARY " ");

}

Public Void RaisSalary (Double Bypercent)

{

Salary * = 1 bypercent / 100;

}

Public int hireyear ()

{

Return Hireday.getyear ();

}

}

I am in f: / java / corejava / corejava / this compilation success

Then I wrote a Test.java code as follows

Import java.util. *;

Import corejava. *;

Public Class Test

{

Public static void main (string [] args)

{

Employee [] staff = new Employee [3];

Staff [0] = New Employee ("Harry Hacker", 3500, New Day (1988, 10, 1));

Staff [1] = New Employee ("Carl Cracker", 7500, New Day (1987, 12, 15);

Staff [2] = New Employee ("Tony Tester", 38000, New Day (1990, 10, 23);

INT I;

For (i = 0; i <3; i ) staff [i] .raisesalary (5);

For (i = 0; i <3; i ) STAFF [i] .print ();

}

}

I put it in F: / java / resulting error, as follows

Test.java: 7:Cannot Access Corejava.employee

Bad Class File: f: /java/corejava/corejava/employee.class

Class File Contains WRONG CLASS: EMPLOYEE

Please Remove Or Make Sure It Appears in The Correct Subdirectory of The ClassPath.

Employee [] staff = new Employee [3];

^

1 Error

Playing in the same directory is working normally, but I added import corejava in Test.java. *;

Thank you for your help, I still want to ask before adding package corejava before the Employee class;

转载请注明原文地址:https://www.9cbs.com/read-78062.html

New Post(0)