@@ -15,7 +15,7 @@ How conflicts are resolved while calling default methods?
## Java 8 中的默认方法是什么?
Default methods enable you to add new functionality to the interfaces of your libraries and ensure binary compatibility with code written for older versions of those interfaces.
FYI, in Java ***null is actually a type***, a special one. It has no name so we cannot declare variables of its type or cast any variables to it; in fact there is only a single value that can be associated with it (i.e. the literal null). Remember that unlike any other types in Java, a null reference can be safely assigned to any other reference types without any error(See [**JLS 3.10.7**](https://docs.oracle.com/javase/specs/jls/se8/html/jls-3.html#jls-3.10.7 "jls 3.10.7") and [**4.1**](https://docs.oracle.com/javase/specs/jls/se8/html/jls-4.html#jls-4.1 "jls 4.1")).
![Java 8 date api changes](img/5347ceb4419cb47506024a8b36bf7bc0.png)
展望未来,JAVA 8([Lambda](//howtodoinjava.com/java8/complete-lambda-expressions-tutorial-in-java/) )有望发布新的日期和时间 API /类( [**JSR-310**](https://java.net/projects/jsr-310/"jsr-310")),也称为 **ThreeTen** ,它将仅更改您到目前为止的操作方式。 这的一个关键部分是提供一个新的 API,该 API 显着易于使用且不易出错。
展望未来,JAVA 8([Lambda](//howtodoinjava.com/java8/complete-lambda-expressions-tutorial-in-java/))有望发布新的日期和时间 API / 类([**JSR-310**](https://java.net/projects/jsr-310/"jsr-310")),也称为 **ThreeTen** ,它将仅更改您到目前为止的操作方式。 这的一个关键部分是提供一个新的 API,该 API 显着易于使用且不易出错。
它将提供一些非常需要的功能,例如:
* 所有关键的公共类都是不可变的并且是线程安全的
* 其他计算领域可以采用的定义的术语和行为
I wrote this post on 15th May 2013\. Now today on 18th Mar 2014, java 8 is finally released and available for early access. I have re-validated and verified all the outputs in post examples. They work like charm as they did in May last year. Only change encountered was in `TemporalAdjuster.java`. Previously it was a class, now it is a **`@FunctionalInterface`**. So, I have corrected the related example and used the class “`TemporalAdjusters.java`“.
当前的 Java SE 平台使用 int 常量表示月份,星期几和 am-pm 等。现在,添加了许多额外的实用程序类,它们在这些枚举的基础上起作用。 我以这样的类为例: [DayOfWeek](https://docs.oracle.com/javase/8/docs/api/java/time/DayOfWeek.html) 。 该类是 day 枚举的包装,并且可以与其他类一致使用。
当前的 Java SE 平台使用`int`常量表示月份,星期几和上午下午等。现在,添加了许多额外的实用程序类,它们在这些枚举的基础上起作用。 我以这样的类为例:[`DayOfWeek`](https://docs.oracle.com/javase/8/docs/api/java/time/DayOfWeek.html)。 该类是每周日期枚举的包装,并且可以与其他类一致使用。
#### 日间周
#### `DayOfWeek`
```java
//day-of-week to represent, from 1 (Monday) to 7 (Sunday)