Java program to SORT MAP based on KEYS

Requirment- To sort MAP based on key using Java

following is the source code-

package techartifact; 

import java.util.*; 

class SortMaps 
{ 

public static void main(String args[]) 
{ 
Map m=new LinkedHashMap(); 

m.put(1,10); 
m.put(3,11); 
m.put(5,15); 
m.put(2,13); 
m.put(4,14); 

Collection c=m.keySet(); 
System.out.println(c); 


Object a[]; 
a = c.toArray(); 

Arrays.sort(a); 

for(int i=0;i<a.length;i++) 
{ 
System.out.println((Object)a[i]); 
} 



} 
}


sort of column of table in ADF -Techartifact

Requirement- To sort an particular column by default on page load.

We can achive by changing the iterator property. Suppose we are having an table and we want to sort the table on page load by taskrole.
Click on bindings –

Now select the right iterator and click on edit

click on sort criteria tab and select the right column and choose sort order-

Happy coding with Techartifact