• Post Reply Bookmark Topic Watch Topic
  • New Topic

Strange compilation problem  RSS feed

 
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I am studying the source code of a working application. It has 2 java classes whose declarations are forming a loop. Hence i dont understand how would they be compiled.
The pseudo code is as:



This is so weird..

If I try to compile either of them. It will give a compile time error saying cannot resolve symbol: <Name of the other class>

Can someone please enlighten me on this one??

Regards,
Shalaka
 
Ranch Hand
Posts: 74
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Check out the class path for the two class files which is located or not.
 
Ranch Hand
Posts: 341
Firefox Browser Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well, what you see is tight coupling. It will require both the classes to be present before you can compile them, moreover, they will require to have access to each other.

It hardly matters otherwise. The only thing that matters is both have to be present in the classpath at the time of compilation.
 
shalaka wadekar
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Right..

So, how do I do that? Any Idea?

Regards,
Shalaka
 
Anubhav Anand
Ranch Hand
Posts: 341
Firefox Browser Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Have a look at how to set classpath.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!