随笔分类 - JAVA知识
摘要:先来个图: 引自: https://www.geeksforgeeks.org/deque-interface-java-example/
阅读全文
摘要:http://www.java2s.com/Tutorials/Java/Java_Language/Basic/Java_double_type.htm
阅读全文
摘要:java中的数据类型,可分为两类: 1.基本数据类型,也称原始数据类型。byte,short,char,int,long,float,double,boolean 他们之间的比较,应用双等号(==),比较的是他们的值。 2.复合数据类型(类) 当他们用(==)进行比较的时候,比较的是他们在内存中的存
阅读全文
摘要:第一种形式是 publicclassSingleton{ privateSingleton(){} privatestaticfinalSingletoninstance=newSingleton(); publicstaticSingletonget...
阅读全文
摘要:In Java, thePriorityQueueclass is implemented as a priority heap. Heap is an important data structure in computer science. For a quick overview of hea...
阅读全文
摘要: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...
阅读全文
摘要:1.How java implements HashMapHashMap Custom implementation in java - How HashMap works internally with diagrams and full programhttp://www.javamadesoe...
阅读全文
摘要:reference:http://fuxueliang.com/tech/2013/05/26/java-sorting-comparator-vs-comparable-tutorial/
阅读全文
摘要:public ArrayList reverse(ArrayList list) { for(int i = 0, j = list.size() - 1; i < j; i++) { list.add(i, list.remove(j)); ...
阅读全文
摘要:Returning null + removing operations:poll(),pollFirst().Returning null + not removing operations:peek(),peekFirst().Throwing exception + removing oper...
阅读全文
摘要:ReentrantLock:http://docs.oracle.com/javase/7/docs/api/java/util/concurrent/locks/ReentrantLock.html#lockInterruptibly()publicvoidlockInterruptibly() ...
阅读全文
摘要:http://lavasoft.blog.51cto.com/62575/991551. What is Mutex andSemaphore?Mutex(mutual exclusion):mutual exclusionrefers to the requirement of ensuring ...
阅读全文
摘要:http://www.cnblogs.com/ukouryou/articles/4079638.html
阅读全文
摘要:方法一: reverse ArrayList1 private void reverse(ArrayList nums, int start, int end) {2 for (int i = start, j = end; i < j; i++, j--) {3 ...
阅读全文
摘要:正确的写法:public static List> function(){ List> list = new ArrayList>(); return list; }错误写法1:public static List> function(){ List>...
阅读全文
摘要:reference: http://www.eecs.yorku.ca/course_archive/2013-14/W/2011/lectures/09%20Loop%20Invariants%20and%20Binary%20Search.pdf
阅读全文
摘要: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 ...
阅读全文
摘要:Reference: http://www.cnblogs.com/skywang12345/p/3308900.html
阅读全文

浙公网安备 33010602011771号