Can't find class outside of package?

D

Digital Puer

Hi, I'm having class/package problems. I have a class Employee in the package
client; it is on disk as:

client/Employee.java


I then have a utility class called Timer.java that does not belong to any
package. In the past I have been able to place Timer.java in the
same directory (in client/ as above) and have Employee be able to find
Timer. However, evidently there has been a change in JDK 1.4.

Can someone tell me where I should put Timer.java (even if I have to
put it into its own package, and if so, where in the directory structure
it should be, and who imports whom)? Thank you.
 
A

Andrew Thompson

Hi, I'm having class/package problems. I have a class Employee in the package
client; ....
I then have a utility class called Timer.java that does not belong to any
package. In the past I have been able to place Timer.java in the
same directory (in client/ as above) and have Employee be able to find
Timer. However, evidently there has been a change in JDK 1.4.

AFAIU, Sun is tightening up the access
of 'no package' classes. If that is the
case, it would be wise to future proof
your class by putting it in a package.

[ I find it odd though, that they ever allowed
you to read and use Timer.class from inside a
package, when loaded by a packaged class. ]
Can someone tell me where I should put Timer.java (even if I have to
put it into its own package, and if so, where in the directory structure
it should be,

Let us assume your drive is..
C:\client\Employee.java
if you decide the best package name is
'utility', you would put Timer.java in..
C:\utility\Timer.java

It is easiest to compile both from C:\
..and who imports whom)?

Well, think about it..

Timer.class exists irregardless of Employee,
it does not specifically require an Employer,
it does not need a PaySlip, nor a yearly
PaySummary, yet each of those classes might
require a Timer, so which do you guess imports
which, and why?
..Thank you.

You're welcome, but please note that questions
of this nature are better directed to c.l.j.help.
 
L

Liz

Andrew Thompson said:
Hi, I'm having class/package problems. I have a class Employee in the package
client; ...
I then have a utility class called Timer.java that does not belong to any
package. In the past I have been able to place Timer.java in the
same directory (in client/ as above) and have Employee be able to find
Timer. However, evidently there has been a change in JDK 1.4.

AFAIU, Sun is tightening up the access
of 'no package' classes. If that is the
case, it would be wise to future proof
your class by putting it in a package.

[ I find it odd though, that they ever allowed
you to read and use Timer.class from inside a
package, when loaded by a packaged class. ]
Can someone tell me where I should put Timer.java (even if I have to
put it into its own package, and if so, where in the directory structure
it should be,

Let us assume your drive is..
C:\client\Employee.java
if you decide the best package name is
'utility', you would put Timer.java in..
C:\utility\Timer.java

It is easiest to compile both from C:\
..and who imports whom)?

Well, think about it..

Timer.class exists irregardless of Employee,
it does not specifically require an Employer,
it does not need a PaySlip, nor a yearly
PaySummary, yet each of those classes might
require a Timer, so which do you guess imports
which, and why?
..Thank you.

You're welcome, but please note that questions
of this nature are better directed to c.l.j.help.

--
Andrew Thompson
http://www.PhySci.org/ Open-source software suite
http://www.PhySci.org/codes/ Web & IT Help
http://www.1point1C.org/ Science & Technology


ir·re·gard·less (îr´î-gärd¹lîs) adverb
Non-Standard.
Regardless.

[Perhaps from ir(respective) + regardless.]

Usage Note: The label Non-Standard does only approximate justice
to the status of irregardless. More precisely, it is a form that
many people mistakenly believe to be a correct usage in formal
style but that in fact has no legitimate antecedents in either
standard or nonstandard varieties. (The word was likely coined
from a blend of irrespective and regardless.) Perhaps this is why
critics have sometimes insisted that there is "no such word" as
irregardless, a charge they would not think of leveling at a bona
fide nonstandard word such as ain't, which has an ancient
genealogy.
 
D

Digital Puer

Thank you very much for your help!


Andrew Thompson said:
Hi, I'm having class/package problems. I have a class Employee in the package
client; ...
I then have a utility class called Timer.java that does not belong to any
package. In the past I have been able to place Timer.java in the
same directory (in client/ as above) and have Employee be able to find
Timer. However, evidently there has been a change in JDK 1.4.

AFAIU, Sun is tightening up the access
of 'no package' classes. If that is the
case, it would be wise to future proof
your class by putting it in a package.

[ I find it odd though, that they ever allowed
you to read and use Timer.class from inside a
package, when loaded by a packaged class. ]
Can someone tell me where I should put Timer.java (even if I have to
put it into its own package, and if so, where in the directory structure
it should be,

Let us assume your drive is..
C:\client\Employee.java
if you decide the best package name is
'utility', you would put Timer.java in..
C:\utility\Timer.java

It is easiest to compile both from C:\
..and who imports whom)?

Well, think about it..

Timer.class exists irregardless of Employee,
it does not specifically require an Employer,
it does not need a PaySlip, nor a yearly
PaySummary, yet each of those classes might
require a Timer, so which do you guess imports
which, and why?
..Thank you.

You're welcome, but please note that questions
of this nature are better directed to c.l.j.help.
 
A

Andrew Thompson

On Mon, 09 Aug 2004 18:31:27 GMT, Liz wrote:

(irregardless)
..a charge they would not think of leveling at a bona
fide nonstandard word such as ain't, which has an ancient
genealogy.

I like that last bit.. :)

[ And further, I will not just *continue* to use
obscure words of doubtful origin, validity and
meaning, but ..heck, I'll happily make words up! :p ]
 
D

Derek

Highly experienced JAVA / Oracle programmers wanted for a three month
contract in South Africa (JHB). Must have had ERP experience with some
integration skills.Open source experience an added advantage. Must be able
to work in a team.

Email CV to (e-mail address removed)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,434
Messages
2,571,691
Members
48,796
Latest member
Greg L.

Latest Threads

Top