This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
Im tryin to use a variable of class x in class y, and vice versa. they are in the same package. Now the problem is i cacnot compile claas x as it says variable not found and niether class y as it gives the same error.
My problem is : i have 2 class x which is the GUI and classs Y which does the prser of the file and gives result. Class Y needs the name of the file which the user accepts through JFIleChooser, and does the work. Now class X calls the method of class y to get results. Now i cant compile class y as it needs the variable from class X and neither can class X as it needs the method from class Y.
Sounds like this oughtta work. (Whether it's a good design or not is for another day.) There are all kinds of "circular references" in common code. Can you include some code and some error messages? Code fragments --- just where things are declared and referenced --- are probably enough. Are you using an IDE or compiling from the command line?
A good question is never answered. It is not a bolt to be tightened into place but a seed to be planted and to bear more seed toward the hope of greening the landscape of the idea. John Ciardi