diff --git a/README.md b/README.md index 05052f73d1039d0fd2d12ffa6cc7571615076019..7c6976179fcb41ce7375e18cc48247dec79595a5 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -Github用户如果访问速度缓慢的话,可以转移到[码云](https://gitee.com/SnailClimb/JavaGuide )查看。 +Github用户如果访问速度缓慢的话,可以转移到[码云](https://gitee.com/SnailClimb/JavaGuide )查看,或者[在线阅读](https://snailclimb.gitee.io/javaguide )。 [阿里云高性能服务器,1核1g最低89,不限性能。](https://www.aliyun.com/minisite/goods?userCode=hf47liqn) @@ -30,8 +30,6 @@ Github用户如果访问速度缓慢的话,可以转移到[码云](https://git

-推荐使用 https://snailclimb.gitee.io/javaguide 在线阅读,在线阅读内容本仓库同步一致。这种方式阅读的优势在于:阅读体验会更好。 - ## 目录 - [Java](#java) diff --git a/docs/java/BIO-NIO-AIO.md b/docs/java/BIO-NIO-AIO.md index 36aac437cff511a02edc3ab07e063b152f574176..7aac2721dcbefea74030303130d68dc254042085 100644 --- a/docs/java/BIO-NIO-AIO.md +++ b/docs/java/BIO-NIO-AIO.md @@ -32,6 +32,12 @@ **同步与异步** +关于同步和异步的概念解读困扰着很多程序员,大部分的解读都会带有自己的一点偏见。参考了 [Stackoverflow](https://stackoverflow.com/questions/748175/asynchronous-vs-synchronous-execution-what-does-it-really-mean)相关问题后对原有答案进行了进一步完善: + +> When you execute something synchronously, you wait for it to finish before moving on to another task. When you execute something asynchronously, you can move on to another task before it finishes. +> +> 当你同步执行某项任务时,你需要等待其完成才能继续执行其他任务。当你异步执行某些操作时,你可以在完成另一个任务之前继续进行。 + - **同步:** 同步就是发起一个调用后,被调用者未处理完请求之前,调用不返回。 - **异步:** 异步就是发起一个调用后,立刻得到被调用者的回应表示已接收到请求,但是被调用者并没有返回结果,此时我们可以处理其他的请求,被调用者通常依靠事件,回调等机制来通知调用者其返回结果。 diff --git "a/docs/java/Java\345\237\272\347\241\200\347\237\245\350\257\206.md" "b/docs/java/Java\345\237\272\347\241\200\347\237\245\350\257\206.md" index 2f214d01ac87887be6346e345f00ec44e2ae5d7c..5566051f7da0b794d0ab286de677e7a45f2fb98d 100644 --- "a/docs/java/Java\345\237\272\347\241\200\347\237\245\350\257\206.md" +++ "b/docs/java/Java\345\237\272\347\241\200\347\237\245\350\257\206.md" @@ -207,14 +207,20 @@ Constructor 不能被 override(重写),但是可以 overload(重载),所 StringBuilder 与 StringBuffer 的构造方法都是调用父类构造方法也就是 AbstractStringBuilder 实现的,大家可以自行查阅源码。 -AbstractStringBuilder.java +`AbstractStringBuilder.java` ```java abstract class AbstractStringBuilder implements Appendable, CharSequence { + /** + * The value is used for character storage. + */ char[] value; + + /** + * The count is the number of characters used. + */ int count; - AbstractStringBuilder() { - } + AbstractStringBuilder(int capacity) { value = new char[capacity]; }