File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Beginning Java and the fly likes Help with sorting Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Help with sorting" Watch "Help with sorting" New topic
Author

Help with sorting

Apostu Paul
Greenhorn

Joined: Sep 05, 2011
Posts: 2
Hello.

I a newbie in java and i ran into a problem at sorting.

I have the following code



I don't know why when i build the project, the desc oerdering doensn't execute.

Any solutions ?

Thank you
Seetharaman Venkatasamy
Ranch Hand

Joined: Jan 28, 2008
Posts: 5575

just verify the flow of control in your program. first please, use braces { ,} for your for loop. and now debug your application!
Seetharaman Venkatasamy
Ranch Hand

Joined: Jan 28, 2008
Posts: 5575

and Welcome to JavaRanch
Apostu Paul
Greenhorn

Joined: Sep 05, 2011
Posts: 2
After i build, the outpus says that this part:



is ignored, so somehow i have to make the desc sorting posible.

P.S. Thank you
Jeanne Boyarsky
internet detective
Marshal

Joined: May 26, 2003
Posts: 29219
    
135

Welcome to CodeRanch!

It sounds like s.getOrder is true? Since either the if or else has to execute. Did you try adding a debug statement to check on this value.


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Help with sorting
 
Similar Threads
nullpointerexception
Sorting order creating problems
ArrayList sorting using comparator performance
IReport:How can i use multi-select statement in jasper
java.lang.ArrayIndexOutOfBoundsException: 1