java package does not exist and bad source file

前端 未结 2 1723
有刺的猬
有刺的猬 2020-12-06 23:43

So I made a folder called util and placed four classes along with program named unit10Assignment in it. I created a package util and typed \" package util; \" at the top of

2条回答
  •  没有蜡笔的小新
    2020-12-07 00:31

    Make sure that:

    • the filename matches the class name (e.g. Employee.java for class Employee)
    • the files are inside the corresponding folder according to their package (i.e. util)

    Are you using any IDE? If not, using one realy helps a lot with this kind of things.

提交回复
热议问题