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

making all files read each other from the same project  RSS feed

 
Enos Winder
Greenhorn
Posts: 18
C++ Java Netbeans IDE
  • Mark post as helpful
  • send pies
  • 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
 
Knute Snortum
Sheriff
Posts: 4073
112
Chrome Eclipse IDE Java Postgres Database VI Editor
  • Mark post as helpful
  • send pies
  • 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
C++ Java Netbeans IDE
  • Mark post as helpful
  • send pies
  • 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: 4073
112
Chrome Eclipse IDE Java Postgres Database VI Editor
  • Mark post as helpful
  • send pies
  • 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
C++ Java Netbeans IDE
  • Mark post as helpful
  • send pies
  • 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: 4073
112
Chrome Eclipse IDE Java Postgres Database VI Editor
  • Mark post as helpful
  • send pies
  • 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.
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!