I want to sort my ArrayList using a boolean type. Basically i want to show entries with true first. Here is my code below:
ArrayList
true
Abc.java
It is also possible that way.
myList.sort((a, b) -> Boolean.compare(a.isSn_Principal(), b.isSn_Principal()));
Java 8:
Collections.sort(abc, (abc1, abc2) -> Boolean.compare(abc2.isClickable(), abc1.isClickable()));