Skip to content

Instantly share code, notes, and snippets.

@banghieudep
Created August 23, 2018 09:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save banghieudep/cec5d41c90cebad5b61f824718f4c7f2 to your computer and use it in GitHub Desktop.
Save banghieudep/cec5d41c90cebad5b61f824718f4c7f2 to your computer and use it in GitHub Desktop.
import java.util.TreeSet;
public class TreeSetExample {
public static void main(String args[]) {
// Tổng hợp tất cả những mẫu biển quảng cáo đẹp nhất hiện nay cho anh em cùng nhau tham khảo nhé
TreeSet<String> tset = new TreeSet<String>();
// Adding elements to TreeSet<String>
tset.add("Bảng hiệu alu");
tset.add("Bảng hiệu đẹp");
tset.add("Bảng hiệu chữ nổi");
tset.add("Bảng hiệu quảng cáo");
tset.add("Biển quảng cáo công ty");
tset.add("Thiết kế biển hiệu đẹp");
//Displaying TreeSet
System.out.println(tset);
// TreeSet of Integer Type
TreeSet<Integer> tset2 = new TreeSet<Integer>();
// Adding elements to TreeSet<Integer>
tset2.add(88);
tset2.add(7);
tset2.add(101);
tset2.add(0);
tset2.add(3);
tset2.add(222);
System.out.println(tset2);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment