java - How can I sort variable values, and then print them in order, largest to smallest? -


i sort list of variables, largest smallest, , print out names of variables. have tried arrays, when printing array out, prints out value of variables, not names.

printing out variable names lies somewhere between extremely tricky (on order of hunting through .class files , hoping best) , downright impossible. if you, i'd use map instead, can map variable values "names" in code, , can sort keys , print values in order.


the problems accessing variable names outlined in answers question linked, basic issue this: if have object no name defined it? if there's more 1 name single object?


Comments

Popular posts from this blog

mongodb - Struggling to get ordered results from the last retrieved article, given array of elements to search in -

c# - Pausing a storyboard on TabItem mouse over -

c# - Attribute value in root node of xml Linq to XML -