• Post Reply 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
  • Tim Cooke
  • Devaka Cooray
  • Ron McLeod
  • Jeanne Boyarsky
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Piet Souris
  • Carey Brown
  • Tim Holloway
Bartenders:
  • Martijn Verburg
  • Frits Walraven
  • Himai Minh

making all files read each other from the same project

 
Greenhorn
Posts: 18
Netbeans IDE C++ Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have three files. All in the same project. I need them to read each other. I just don't know how. here is my code.





Now of course this isn't my whole code. I don't think you want everything that I have. I just need these three files to start talking to each other
 
Sheriff
Posts: 7123
184
Eclipse IDE Postgres Database VI Editor Chrome Java Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
(I fixed the code tags for you. you have to write "code=java" not "code = java", or just use the Code button.)

What do you mean by "read"? Do they need to pass information to each other? Asynchronously?
 
Enos Winder
Greenhorn
Posts: 18
Netbeans IDE C++ Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
appreciate the help and yes they need to be able to pass information. In my GUI is a sort method. In the DLinkedList is a node reverse method. I need those to talk to each other.
 
Knute Snortum
Sheriff
Posts: 7123
184
Eclipse IDE Postgres Database VI Editor Chrome Java Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If it's not as simple as (in the DLinkedList class)...

...then what is it you need to do? Posting the sort and reverse code may help.
 
Enos Winder
Greenhorn
Posts: 18
Netbeans IDE C++ Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Ok, here is my sort method


and here is my reverse method


These two need to talk to each other.
 
Knute Snortum
Sheriff
Posts: 7123
184
Eclipse IDE Postgres Database VI Editor Chrome Java Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Do you want strings to be reversed after it's sorted? You can't use your reverse() method because it reverses linked lists, not String[]s.

The best way to do this is to use Arrays.sort(T[] a, Comparator<? super T> c). The Javadoc is here.

Can you tell us exactly what you're trying to do? I can explain the Comparator more if I know that's what you need.
 
My cellmate was this tiny ad:
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic