'JAVA Package won't import even though it was declared [duplicate]
I'm trying to compile a program but it always displays an error that my package cannot be found but its properly declared (i think)
The exact error im getting
Here's the beginning part of the code of the program im packaging:
package domain;
public class Person {
private String name;
private int empNO;
private int age;
and here's the beginning of the program Im importing it into:
package test;
import domain.*;
public class TestPerson {
public static void main (String args[]) {
this is essentially the directory of the project:
Solution 1:[1]
Try import com.companyName.department.domain. I think its because you didn't specify the whole path of the package you were trying to import.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | toadpen |
