Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Package: resolving the class  RSS feed

 
Syed Khateeb
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

I have created a directory named check inside a default directory, with two source files A.java & B.java.

//B.java
package check;
public class B{
void count()
{
System.out.println("This is count");
}
}

//A.java
package check;
public class A{
public static void main(String[] arg)
{
B b = new B();
b.count();
}
}

B.java compiles fine, but A.java doesn't compile & says
cannot find symbol class B
.

whats the problem in my understanding?
 
Petrus Pelser
Ranch Hand
Posts: 132
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Did you include the current directory in your classpaths?
 
Syed Khateeb
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well i did it now & its working fine.

Thank you.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!