摘要:
转自http://tutorials.jenkov.com/java-concurrency/volatile.htmlThe Javavolatilekeyword is used to mark a Java variable as "being stored in main memory". ... 阅读全文
摘要:
反射,提供了一种在程序运行期间分析类型的能力虚拟机为每种类型管理一个Class对象Object中的getClass方法会返回一个Class实例Date d = new Date();Class c = d.getClass();String name = c.getName(); //name被设置... 阅读全文
摘要:
Spring - MVC处理过程:Following is the sequence of events corresponding to an incoming HTTP request toDispatcherServlet:After receiving an HTTP request,Dis... 阅读全文
摘要:
HashSetdoesn’t maintain any kind of order of its elements.TreeSetsorts the elements in ascending order.LinkedHashSetmaintains the insertion order. Ele... 阅读全文
摘要:
λ表达式本质上是一个匿名方法。让我们来看下面这个例子: public int add(int x, int y) { return x + y; }转成λ表达式后是这个样子: (int x, int y) -> x + y;参数类型也可以省略,Java编译器会根据上下文推断出来: (x, y) ->... 阅读全文
摘要:
protected access requires a little more elaboration. Supposeclass A declares a protected field xand isextended by a class B, which isdefined in a diff... 阅读全文