Mark Supinski

Greenhorn
+ Follow
since May 14, 2010
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Mark Supinski

So I found my own solution.

package classes must be in a directory with a name corresponding to the package declaration. Moving the files into a foobar directory eliminated the runtime exception.

Note, however that java must be invoked from the root level. Thus, if one runs java Moo from within the foobar directory, the runtime exception occurs. If one steps back to the parent directory and runs java foobar/Moo it works properly.

Mark
Hi All-

Working my way through S&B and ran into a behavior I don't understand.

Here's the code:


This code compiles fine. When trying to run the code, however, I get a runtime exception as follows:


My question is this: If I remove the package statements from this file and the associated Zoo.java file, the code runs fine. With the package statements, I get the runtime error above.

I can't find an explanation of this behavior anywhere. Can someone enlighten me?

Thanks,

MArk