随笔分类 -  JAVA知识

摘要:先来个图: 引自: https://www.geeksforgeeks.org/deque-interface-java-example/ 阅读全文
posted @ 2018-10-08 11:21 Hygeia 阅读(137) 评论(0) 推荐(0)
摘要:http://www.java2s.com/Tutorials/Java/Java_Language/Basic/Java_double_type.htm 阅读全文
posted @ 2016-07-25 12:32 Hygeia 阅读(232) 评论(0) 推荐(0)
摘要:java中的数据类型,可分为两类: 1.基本数据类型,也称原始数据类型。byte,short,char,int,long,float,double,boolean 他们之间的比较,应用双等号(==),比较的是他们的值。 2.复合数据类型(类) 当他们用(==)进行比较的时候,比较的是他们在内存中的存 阅读全文
posted @ 2016-06-29 04:35 Hygeia 阅读(455) 评论(0) 推荐(0)
摘要:第一种形式是 publicclassSingleton{ privateSingleton(){} privatestaticfinalSingletoninstance=newSingleton(); publicstaticSingletonget... 阅读全文
posted @ 2016-01-27 13:01 Hygeia 阅读(416) 评论(0) 推荐(0)
摘要:In Java, thePriorityQueueclass is implemented as a priority heap. Heap is an important data structure in computer science. For a quick overview of hea... 阅读全文
posted @ 2016-01-26 00:38 Hygeia 阅读(309) 评论(0) 推荐(0)
摘要:Many of the Java programmers know what 'Hashcode' means, but don't really know how exactly it is calculated and why 31 is used to calculate the hashco... 阅读全文
posted @ 2016-01-22 02:41 Hygeia 阅读(211) 评论(0) 推荐(0)
摘要:1.How java implements HashMapHashMap Custom implementation in java - How HashMap works internally with diagrams and full programhttp://www.javamadesoe... 阅读全文
posted @ 2016-01-22 02:00 Hygeia 阅读(248) 评论(0) 推荐(0)
摘要:reference:http://fuxueliang.com/tech/2013/05/26/java-sorting-comparator-vs-comparable-tutorial/ 阅读全文
posted @ 2016-01-22 00:51 Hygeia 阅读(152) 评论(0) 推荐(0)
该文被密码保护。
posted @ 2016-01-06 03:31 Hygeia 阅读(16) 评论(0) 推荐(0)
摘要:public ArrayList reverse(ArrayList list) { for(int i = 0, j = list.size() - 1; i < j; i++) { list.add(i, list.remove(j)); ... 阅读全文
posted @ 2015-12-31 05:51 Hygeia 阅读(187) 评论(0) 推荐(0)
摘要:Returning null + removing operations:poll(),pollFirst().Returning null + not removing operations:peek(),peekFirst().Throwing exception + removing oper... 阅读全文
posted @ 2015-12-30 06:26 Hygeia 阅读(140) 评论(0) 推荐(0)
摘要:ReentrantLock:http://docs.oracle.com/javase/7/docs/api/java/util/concurrent/locks/ReentrantLock.html#lockInterruptibly()publicvoidlockInterruptibly() ... 阅读全文
posted @ 2015-10-02 09:57 Hygeia 阅读(155) 评论(0) 推荐(0)
摘要:http://lavasoft.blog.51cto.com/62575/991551. What is Mutex andSemaphore?Mutex(mutual exclusion):mutual exclusionrefers to the requirement of ensuring ... 阅读全文
posted @ 2015-10-02 09:57 Hygeia 阅读(102) 评论(0) 推荐(0)
摘要:http://www.cnblogs.com/ukouryou/articles/4079638.html 阅读全文
posted @ 2015-10-02 06:34 Hygeia 阅读(159) 评论(0) 推荐(0)
摘要:方法一: reverse ArrayList1 private void reverse(ArrayList nums, int start, int end) {2 for (int i = start, j = end; i < j; i++, j--) {3 ... 阅读全文
posted @ 2015-09-25 01:04 Hygeia 阅读(165) 评论(0) 推荐(0)
摘要:正确的写法:public static List> function(){ List> list = new ArrayList>(); return list; }错误写法1:public static List> function(){ List>... 阅读全文
posted @ 2015-08-05 05:44 Hygeia 阅读(1627) 评论(0) 推荐(0)
只有注册用户登录后才能阅读该文。
posted @ 2015-07-27 11:01 Hygeia 阅读(9) 评论(0) 推荐(0)
摘要:reference: http://www.eecs.yorku.ca/course_archive/2013-14/W/2011/lectures/09%20Loop%20Invariants%20and%20Binary%20Search.pdf 阅读全文
posted @ 2015-07-14 17:31 Hygeia 阅读(118) 评论(0) 推荐(0)
摘要:1 import java.util.*; 2 import java.io.*; 3 import java.nio.file.*; 4 import java.lang.StringBuilder; 5 6 class FilePrep { 7 public static void ... 阅读全文
posted @ 2015-07-05 13:02 Hygeia 阅读(292) 评论(0) 推荐(0)
摘要:Reference: http://www.cnblogs.com/skywang12345/p/3308900.html 阅读全文
posted @ 2015-06-05 06:54 Hygeia 阅读(254) 评论(0) 推荐(0)