Java8 sorted list of (n reverse order)

Man of few words said, directly on dry goods

 

 

I wrote here a list of three arrays inside add the Order entity (my ucId, price, qty are int type)

The first instance: I've made small to large sort of price (my price is of type int)

 

 

 

 

 

 Obviously the first approach here has been given a prompt, make use of a second, more concise way to write.

A second example: I've made positive sequence sort price and qty

 

 

 Obviously there is also recommended to use the second approach

Well, the focus here

A third example: positive sequence of price, qty reverse

I started to write so

 

 

 The first way to get results (correct)

 

 

 The results (errors) The second way to get to see the source code should be able to see, here's just sort of a state of mind to sort of put the whole sort are arranged in reverse order to go, so the results obtained here is certainly wrong

Then I was online a variety of Baidu (most of them are irresponsible that they should have not personally tried it)

Later we found that there is a way to modify the source code after viewing

 

 

 The results obtained

 

 Well, today's share on here, if wrong place, please also pointing out, to help you to remember the thumbs up yo.

 

Guess you like

Origin www.cnblogs.com/lqtbk/p/11607023.html