I'm running on Netbeans 8.0.2 and I don't know I can't use the Collections.sort(), I have this error.
The type of Sort(Comparator<? super E> is erroneous where E is a type-variable : E extends object declared in class ArrayList
Example of code :
private void chargeData(String fileName) {
base.ArticleDao.listeArticles = base.ArticleDao.getListeArticles(fileName);
base.ArticleDao.listeArticles.sort(null);
//Collections.sort(listeArticles);
for (int i = 0; i < base.ArticleDao.listeArticles.size(); i++) {
lstArticles.add(base.ArticleDao.listeArticles.get(i).toString());
}
}//chargeData
I'm using Collections.sort() in order to.... sort my arrayList but I have this error, even I do :
myArrayList.sort(null) in order to use compareTo().
Do you have some ideas for the configuration on netbeans ? I tested on my school computer, and it was worked.
Thank you for taking time on my problem and have a nice day full of code =)
Collections.sort(myArrayList);is not the same asmyArrayList.sort();.Collections.sort().