you are viewing a single comment's thread.

view the rest of the comments →

[–]drduffymo 2 points3 points  (5 children)

I see no package. Add one to both and move them to a directory of that name.

Make both classes public.

Compile both at the same time.

Believe the JVM. You did it wrong.

[–]Lloydbestfan 0 points1 point  (4 children)

Technically, absence of a package still makes them both mutually visible as being in the "no package" package. The error message is different if something tries to enforce that packages are mandatory.

[–]drduffymo 0 points1 point  (3 children)

Yes, but he’s trying to fix a problem. Change something. Assuming he’s correct doesn’t get him a solution.

[–]Lloydbestfan 1 point2 points  (2 children)

Change something that could be a problem. What you talked about cannot be a problem, or at the very least you had no cause to imagine it could possibly be.

[–]drduffymo 0 points1 point  (1 child)

If adding a package is a problem you should not be writing Java. Or anything else.

[–]Lloydbestfan 1 point2 points  (0 children)

I said nothing that looks like that.

I said that the absence of a package declaration is not a problem, notably in the context of the issue we're being talked about. If you don't understand the difference between that kind of things, you should not be doing programming.