先贴出输出:
TreeSet Integer
会合为:[-一, 零, 六, 八, 66]
改动temp为:55
聚合为:[-一, 零, 六, 八, 66]聚合尚未由于temp的改变而改变,说明java对根本部类做了非一般处置
-----------------------------
TreeSet 自定义的Int
会合为:[六, 66]
treeSet.contains(六)= true
treeSet.contains(66)= true
改动temp为:-55
会合为:[六, -55]聚合由于temp的改变而改变,但排序尚无改变
treeSet.contains(六)= false
treeSet.contains(66)= false
treeSet.contains(-55)= true
代码:
Java代码
一.package Tests;
2.
三.import java.util.Arrays;
四.import java.util.HashSet;
五.import java.util.Iterator;
六.import java.util.LinkedList;
七.import java.util.List;
八.import java.util.ListIterator;
九.import java.util.Set;
十.import java.util.SortedSet;
11.import java.util.TreeSet;
12.
13.public class testSet {
14. public static void main(String[] args) {
15.// testHashSet();
16. testTreeSet();//数据自动排序
17. System.out.println("-----------------------------");
18. testTreeSetInt();// 数据自动排序
19.
20. // testLinkedList();
21.
22. }
23.
24. private static void testLinkedList() {
25. LinkedList
- 1895 - org.springframework.web.util.NestedServletException: Request processing failed
- 1896 - org.hibernate.MappingException: An AnnotationConfiguration instance is required to use
- 1897 - java.sql.SQLException: [Microsoft][ODBC Microsoft Access Driver] UPDATE 语句的语法错误
- 1898 - 若要使他人能够在远程计算机上查看此特定错误信息的详细信息
- 1899 - Failed to convert parameter value from a String to a Int32
- 1900 - PageError事件捕获出错信息
- 1901 - org.hibernate.exception.GenericJDBCException: could not insert
- 1902 - Error creating temporary file
- 1903 - Unhandled exception type UsersException
- 1904 - inputstreamreader.read()
- 1905 - Uncaught Throwable in thread : PeerView Timer for urn:jxta:jxta-NetGroup
- 1906 - unknown software exception (0xc00000fd)
- 1907 - System.ArgumentException: 路径中具有非法字符
- 1908 - Could not load file or assembly
- 1909 - See the end of this message for details on invoking
- 1910 - CrystalDecisions.CrystalReports.Engine.ParameterFieldCurrentValueException: 丢失参数字段当前值
- 1911 - GetContext method Cannot be null
- 1912 - 用户代码未处理 SqlException
- 1913 - 80080005
- 1914 - Linux下oracle字符集设置