Classes in same package

Posted by nicholas_r on Stack Overflow See other posts from Stack Overflow or by nicholas_r
Published on 2012-04-17T15:24:18Z Indexed on 2012/10/10 21:38 UTC
Read the original article Hit count: 119

Filed under:
|

I love the Intellij IDEA but i have been stacked on one little problem with Java imports. So for example there is a package with name "example" and two different classes in it: A.java and B.java.

And i wanna get access to class "A" from class "B" without imports. Like this:

class A:

package example;

public class A{ ... some stuff here ...}

class B:

package example;

public class B{
    public static void main(String[] args){
        A myVar = 1234;
    }
}

This code may not work, but it's doesn't matter. Trouble just with IDE and with its mechanism of importing classes.

So, problem is that i can't see A class from B. Idea says 'Cant resolve symbol' but i actually know that class A exists in package. Next strange is that complier works fine and there are no exceptions. Just IDEA can't see the class in the same package.

Does anybody has any ideas?

© Stack Overflow or respective owner

Related posts about java

Related posts about intellij-idea