Error in java package problem.
While doing practice with packages I have got an error. Can anyone tell me what is the error and the solution? Thank You.
Voters
SixBeeps
The package
keyword is for telling the compiler which package the current class belongs to. You made Main.java a part of the mypack package, but it should be packageless. Instead, replace package
with import
to be able to use the stuff in mypack.
Instead of using
package
(that's for local files in a package), useimport
:Note how you don't have to add
mypack
:)read more