The following code is not highlighted as an error:
public class Test {
publicstatic void main(String[] args) {
new somePackage(); // the project has a package called "somePackage" but no such class exists
new java.lang();
}
}
But the compiler will give the following errors from it:
Error:Error:line (3)cannot find symbol class somePackage
Error:Error:line (4)cannot find symbol class lang
It is highlighted as an error only when no package with such a name exist (see the attached picture).
Description
The following code is not highlighted as an error:
public class Test {
publicstatic void main(String[] args) {
new somePackage(); // the project has a package called "somePackage" but no such class exists
new java.lang();
}
}
But the compiler will give the following errors from it:
Error:Error:line (3)cannot find symbol class somePackage
Error:Error:line (4)cannot find symbol class lang
It is highlighted as an error only when no package with such a name exist (see the attached picture).