{"id":285,"date":"2019-01-29T13:40:59","date_gmt":"2019-01-29T05:40:59","guid":{"rendered":"https:\/\/qtvz.com\/?p=285"},"modified":"2019-01-29T13:40:59","modified_gmt":"2019-01-29T05:40:59","slug":"jdk%e6%ba%90%e7%a0%81%e9%98%85%e8%af%bb%e9%a1%ba%e5%ba%8f","status":"publish","type":"post","link":"https:\/\/qtvz.com\/285.html","title":{"rendered":"JDK\u6e90\u7801\u9605\u8bfb\u987a\u5e8f"},"content":{"rendered":"<!--wp-compress-html--><!--wp-compress-html no compression-->\n<p><strong><em>1\u3001java.lang<\/em><\/strong><\/p>\n\n\n\n<p> \u5f88\u591ajava\u5f00\u53d1\u7684\u5c0f\u4f19\u4f34\u90fd\u4f1a\u9605\u8bfbjdk\u6e90\u7801\uff0c\u7136\u800c\u786e\u4e0d\u77e5\u9053\u5e94\u8be5\u4ece\u54ea\u8bfb\u8d77\u3002\u4ee5\u4e0b\u4e3a\u5c0f\u7f16\u6574\u7406\u7684\u901a\u5e38\u6240\u9700\u9605\u8bfb\u7684\u6e90\u7801\u8303\u56f4\u3002\u00a0<br>\u6807\u9898\u4e3a\u5305\u540d\uff0c\u540e\u9762\u5e8f\u53f7\u4e3a\u4f18\u5148\u7ea71-4\uff0c\u4f18\u5148\u7ea7\u9012\u51cf\u00a0 <\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>1) Object 1\n 2) String 1\n 3) AbstractStringBuilder 1\n 4) StringBuffer 1\n 5) StringBuilder 1\n 6) Boolean 2\n 7) Byte 2\n 8) Double 2\n 9) Float 2\n 10) Integer 2\n 11) Long 2\n 12) Short 2\n 13) Thread 2\n 14) ThreadLocal 2\n 15) Enum 3\n 16) Throwable 3\n 17) Error 3\n 18) Exception 3\n 19) Class 4\n 20) ClassLoader 4\n 21) Compiler 4\n 22) System 4\n 23) Package 4\n 24) Void 4<\/code><\/pre>\n\n\n\n<p><strong><em>2\u3001java.util<\/em><\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>1) AbstractList 1\n 2) AbstractMap 1\n 3) AbstractSet 1\n 4) ArrayList 1\n 5) LinkedList 1\n 6) HashMap 1\n 7) Hashtable 1\n 8) HashSet 1\n 9) LinkedHashMap 1\n 10) LinkedHashSet 1\n 11) TreeMap 1\n 12) TreeSet 1\n 13) Vector 2\n 14) Queue 2\n 15) Stack 2\n 16) SortedMap 2\n 17) SortedSet 2\n 18) Collections 3\n 19) Arrays 3\n 20) Comparator 3\n 21) Iterator 3\n 22) Base64 4\n 23) Date 4\n 24) EventListener 4\n 25) Random 4\n 26) SubList 4\n 27) Timer 4\n 28) UUID 4\n 29) WeakHashMap 4<\/code><\/pre>\n\n\n\n<p><strong><em>3\u3001java.util.concurrent<\/em><\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>1) ConcurrentHashMap 1\n 2) Executor 2\n 3) AbstractExecutorService 2\n 4) ExecutorService 2\n 5) ThreadPoolExecutor 2\n 6) BlockingQueue 2\n 7\uff09AbstractQueuedSynchronizer 2\n 8\uff09CountDownLatch 2\n 9) FutureTask 2\n 10\uff09Semaphore 2\n 11\uff09CyclicBarrier 2\n 13\uff09CopyOnWriteArrayList 3\n 14\uff09SynchronousQueue 3\n 15\uff09BlockingDeque 3\n 16) Callable 4<\/code><\/pre>\n\n\n\n<p><strong><em>4\u3001java.util.concurrent.atomic<\/em><\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>1) AtomicBoolean 2\n2) AtomicInteger 2\n3) AtomicLong 2\n4) AtomicReference 3<\/code><\/pre>\n\n\n\n<p><strong><em>5\u3001java.lang.reflect<\/em><\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>1) Field 2\n2) Method 2<\/code><\/pre>\n\n\n\n<p><strong><em>6\u3001java.lang.annotation<\/em><\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>1) Annotation 3\n2) Target 3\n3) Inherited 3\n4) Retention 3\n5) Documented 4\n6) ElementType 4\n7) Native 4\n8) Repeatable 4<\/code><\/pre>\n\n\n\n<p><strong><em>7\u3001java.util.concurrent.locks<\/em><\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>1) Lock 2\n2) Condition 2\n3) ReentrantLock 2\n4) ReentrantReadWriteLock 2<\/code><\/pre>\n\n\n\n<p><strong><em>8\u3001java.io<\/em><\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>1) File 3\n2) InputStream   3\n3) OutputStream  3\n4) Reader  4\n5) Writer  4<\/code><\/pre>\n\n\n\n<p><strong><em>9\u3001java.nio<\/em><\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>1) Buffer 3\n2) ByteBuffer 4\n3) CharBuffer 4\n4) DoubleBuffer 4\n5) FloatBuffer 4\n6) IntBuffer 4\n7) LongBuffer 4\n8) ShortBuffer 4<\/code><\/pre>\n\n\n\n<p><strong><em>10\u3001java.sql<\/em><\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>1) Connection 3\n2) Driver 3\n3) DriverManager 3\n4) JDBCType 3\n5) ResultSet 4\n6) Statement 4<\/code><\/pre>\n\n\n\n<p><strong><em>11\u3001java.net<\/em><\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>1) Socket 3\n2) ServerSocket 3\n3) URI 4\n4) URL 4\n5) URLEncoder 4<\/code><\/pre>\n\n\n\n<p class=\"has-background has-vivid-cyan-blue-background-color\">\u9605\u8bfb\u7b14\u8bb0\u7b80\u7248<\/p>\n\n\n\n<p> 1\u3001Object <br> 1) wait(), notify(), notifyAll(), wait(timeout) <br> 2) hashCode(), equals() <br> 3) clone()<\/p>\n\n\n\n<p>2\u3001String <br>\n1) char[] value <br>\n2) int hash <br>\n3) equals(), startWith(), endWith(), replace<\/p>\n\n\n\n<p>3\u3001AbstractStringBuilder <br>\n1) char[] value <br>\n2) int count <br>\n3) \u6269\u5bb9\uff1a\u7ffb\u500d\uff0c\u4e0d\u591f\u53d6\u6240\u9700\u6700\u5c0f<\/p>\n\n\n\n<p>4\u3001StringBuffer <br>\n1) \u7ee7\u627fAbstractStringBuilder <br>\n2) synchronized\u65b9\u6cd5\u4fdd\u8bc1\u7ebf\u7a0b\u5b89\u5168 <br>\n3) char[] toStringCache<\/p>\n\n\n\n<p>5\u3001StringBuilder \u7ee7\u627fAbstractStringBuilder<\/p>\n\n\n\n<p>6\u3001ArrayList <br>\n1) Object[] elementData <br>\n2) int size <br>\n3) \u9ed8\u8ba4\u5927\u5c0f10 <br>\n4) \u6269\u5bb9\uff1a\u7ffb\u500d\uff0c\u4e0d\u591f\u53d6\u6240\u9700\u6700\u5c0f<\/p>\n\n\n\n<p>7\u3001LinkedList <br>\n1) Node {E item, Node prev, Node next} <br>\n2) int size <br>\n3) Node first <br>\n4) Node last <br>\n5) linkFirst(), linkLast(), linkBefore(), unLinkFirst(), unLinkLast(), unLink(), indexOf()<\/p>\n\n\n\n<p>8\u3001HashMap <br>\n1) Node{int hash, K key, V value, Node next} <br>\n2) \u9ed8\u8ba4\u5bb9\u91cf16\uff0c\u8d1f\u8f7d\u56e0\u5b500.75f <br>\n3) int size, modCount, threshold, float loadFactor <br>\n4) Node[] table <br>\n5) Set entrySet <br>\n6) put():\u6839\u636ekey\u7b97hash\uff0c\u6839\u636e\u5bb9\u91cf\u548chash\u7b97index\uff0ctable[index]\u6ca1\u6709\u76f4\u63a5\u6dfb\u52a0\u5230\u6570\u7ec4\u4e2d\uff0ctable[index]\u6709\uff0c\u82e5index\u4f4d\u7f6e\u540c\u4e00\u4e2akey\u5219\u66f4\u65b0\uff0c\u5426\u5219\u904d\u5386next\u662f\u5426\u6709\uff0c\u6709\u5219\u66f4\u65b0\uff0c\u65e0\u5219\u65b0\u589e\uff0c\u6700\u540e\u6839\u636ethread\u4e0esize\u5224\u65ad\u662f\u5426\u6269\u5bb9\u3002\u6ce8\uff1a\u6269\u5bb9\u65f6\u5bb9\u91cf\u7ffb\u500d\uff0c\u91cd\u65b0\u7b97hash\u590d\u5236\u5230\u65b0\u6570\u7ec4 <br>\n7\uff09get()\u7c7b\u4f3c <br>\n\u6ce8\uff1a\u5148\u6bd4\u8f83hash\uff0c\u82e5\u76f8\u7b49\u5728\u6bd4\u8f83equals<\/p>\n\n\n\n<p>9\u3001Hashtable <br>\n1) \u7ed3\u6784\u5b9e\u73b0\u4e0eHashMap\u57fa\u672c\u4e00\u81f4 <br>\n2)\u901a\u8fc7synchronized\u65b9\u6cd5\u4fdd\u8bc1\u7ebf\u7a0b\u5b89\u5168<\/p>\n\n\n\n<p>10\u3001HashSet\uff1a\u59d4\u6258\u7ed9HashMap\uff0c\u5176Value\u662f\u540c\u4e00\u4e2a\u9ed8\u8ba4\u5bf9\u8c61<\/p>\n\n\n\n<p>11\u3001LinkedHashMap\u7ee7\u627fHashMap <br>\n1) Entry{HashMap.Node, Entry before, after} <br>\n2) Entry head, tail <br>\n3) \u91cd\u5199newNode()\u6dfb\u52a0\u8282\u70b9\u65f6\uff0c\u9664\u50cfHashMap\u4e2d\u6dfb\u52a0\u5916\uff0c\u4fdd\u5b58before\u3001after\u4fe1\u606f<\/p>\n\n\n\n<p>12\u3001LinkedHashSet\u7ee7\u627fHashSet\uff1a\u4e0d\u77e5\u9053\u5982\u4f55\u5b9e\u73b0\u7684\u987a\u5e8f\uff1f<\/p>\n\n\n\n<p>13\u3001AbstractMap\u7ef4\u62a4EntrySet\uff0cAbstractSet\u7ef4\u62a4Iterator\uff0cAbstractList\u7ef4\u62a4Iterator<\/p>\n\n\n\n<p>14\u3001ConcurrentHashMap <br>\n1) JDK1.7\u53ca\u4ee5\u524d\uff1a <br>\na\u3001Segment[] ,HashEntry[] , HashEntry{hash, k, v, next} <br>\nb\u3001\u6839\u636ekey\u7b97hash\uff0c\u6839\u636ehash\u548cSegment\u7684\u5927\u5c0f\u7b97\u4f4d\u7f6e\uff0c\u6bcf\u4e2asegment\u62e5\u6709\u4e00\u4e2a\u81ea\u5df1\u7684HashEntry[] <br>\nc\u3001get()\uff1a\u4e0d\u52a0\u9501\uff0cvolatile\u7c7b\u578b <br>\nd\u3001put(): \u5bf9\u76f8\u5e94segment\u52a0\u9501 <br>\ne\u3001size()\uff1a\u5404HashEntry[] \u4e4b\u548c\uff0c\u5148\u4e0d\u52a0\u9501\u7b97\u4e24\u904d\uff0c\u82e5\u4e00\u81f4\u5219\u8fd4\u56de\uff0c\u82e5\u4e0d\u4e00\u81f4\u5219\u52a0\u9501\u91cd\u65b0\u8ba1\u7b97 <br>\n2\uff09JDK1.8 <br>\na\u3001Node{hash, key, value, next} <br>\nb\u3001Node[] table <br>\nc\u3001\u5927\u591a\u6570\u64cd\u4f5c\u7c7b\u4f3c\u4e8eHashMap\uff0c\u4e0d\u540cCAS\u65b9\u5f0f\u8bbe\u7f6e\uff0c\u6839\u636ekey\u7b97hash\uff0c\u5728\u6839\u636ehash\u548c\u5bb9\u91cf\u7b97index\uff0c\u5bf9table[index]\u52a0\u9501\uff0c\u4ece\u800c\u8fbe\u5230\u66f4\u5927\u7684\u5e76\u53d1\u91cf <br>\nd\u3001get(): \u540cHashMap <br>\ne\u3001put(): \u5bf9table[index]\u52a0\u9501<\/p>\n\n\n\n<p>15\u3001TreeMap <br> 1\uff09\u7ea2\u9ed1\u6811\uff0c\u5373\u81ea\u5e73\u8861\u4e8c\u53c9\u67e5\u627e\u6811\uff0c\u65f6\u95f4\u590d\u6742\u5ea6O(logn) <br> 2\uff09Entry{K k, V v, Entry parent, left, right, boolean color} <br> 3\uff09Entry root\uff0cint size\uff0c int modeCount <br>16\u3001TreeSet\uff1a\u59d4\u6258TreeMap\u5b9e\u73b0 <\/p>\n\n\n\n<p> \u539f\u6587\uff1ahttps:\/\/blog.csdn.net\/qq_21033663\/article\/details\/79571506 <\/p>\n<!--wp-compress-html no compression--><!--wp-compress-html-->","protected":false},"excerpt":{"rendered":"1\u3001java.lang \u5f88\u591ajava\u5f00\u53d1\u7684\u5c0f\u4f19\u4f34\u90fd\u4f1a\u9605\u8bfbjdk\u6e90\u7801\uff0c\u7136\u800c\u786e\u4e0d\u77e5\u9053\u5e94\u8be5\u4ece\u54ea\u8bfb\u8d77\u3002\u4ee5\u4e0b\u4e3a\u5c0f\u7f16\u6574\u7406\u7684\u901a\u5e38\u6240\u9700\u9605\u8bfb\u7684\u6e90\u7801\u8303\u56f4\u3002\u00a0\u6807\u9898\u4e3a\u5305\u540d\uff0c\u540e\u9762\u5e8f\u53f7\u4e3a\u4f18\u5148\u7ea71-4\uff0c\u4f18\u5148\u7ea7\u9012\u51cf\u00a0 2\u3001java. \u00b7\u00b7\u00b7","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[40],"tags":[69],"views":13621,"_links":{"self":[{"href":"https:\/\/qtvz.com\/api\/wp\/v2\/posts\/285"}],"collection":[{"href":"https:\/\/qtvz.com\/api\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/qtvz.com\/api\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/qtvz.com\/api\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/qtvz.com\/api\/wp\/v2\/comments?post=285"}],"version-history":[{"count":3,"href":"https:\/\/qtvz.com\/api\/wp\/v2\/posts\/285\/revisions"}],"predecessor-version":[{"id":288,"href":"https:\/\/qtvz.com\/api\/wp\/v2\/posts\/285\/revisions\/288"}],"wp:attachment":[{"href":"https:\/\/qtvz.com\/api\/wp\/v2\/media?parent=285"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/qtvz.com\/api\/wp\/v2\/categories?post=285"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/qtvz.com\/api\/wp\/v2\/tags?post=285"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}