• Post Reply Bookmark Topic Watch Topic
  • New Topic

Help with sorting  RSS feed

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Ranch Hand
Posts: 5575
Eclipse IDE Java Windows XP
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 5575
Eclipse IDE Java Windows XP
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
and Welcome to JavaRanch
 
Apostu Paul
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
author & internet detective
Sheriff
Posts: 37811
582
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
All of the world's problems can be solved in a garden - Geoff Lawton. Tiny ad:
The WEB SERVICES and JAX-RS Course
https://coderanch.com/t/690789/WEB-SERVICES-JAX-RS
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!