Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

urgent: please help: importing variables interdependent classes

 
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
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.

Please advice
 
(instanceof Sidekick)
Posts: 8791
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
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?
 
drifter
Posts: 1364
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
This thread was also posted in "Java in General (advanced)". Please don't cross-post.

You got more answers over there. Maybe because you didn't put "urgent" in the subject. Please don't.
 
Sheriff
Posts: 4313
Android IntelliJ IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
Please don't post the same thread in multiple forums. It makes a conversation difficult to follow, and wastes peoples time when they answer a question that's already been answered elsewhere.

Please continue teh conversation here.
    Bookmark Topic Watch Topic
  • New Topic