Java) 정렬, Collections 사용
Java에서 정렬을 하려면, TreeSet을 이용하는 방법이 있다. 또 다른 방법으로는, Collections 클래스를 활용하는 방법이 있다. Song 클래스를 다음과 같이 정의하자 public class Song { private String title; private String author; private int rank; public String getTitle() { return title; } public void setTitle(String title) { this.title = title; } public String getAuthor() { return author; } public void setAuthor(String author) { this.author = author; } pub..
2008.06.02