Skip to content

Commit 2c3d6c8

Browse files
committed
[Fix] Fix contents
1 parent 01109f6 commit 2c3d6c8

12 files changed

Lines changed: 60 additions & 35 deletions

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# 介绍
22

3-
这本书其实是我的一本笔记
3+
这本书其实是我的一本笔记 (还在整理中)
44

55
记录了我面试遇到的问题以及我在网上整理的一些资料 主要是面向 junior 级别的 就是我们这些小菜鸟啦 ~
66

SUMMARY.md

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,6 @@
2828
* [Singleton 单例模式](java/what_is_singleton_class.md)
2929
* [hashcode 和 equal](java/hashcode__equal.md)
3030
* [== 和 equal 的区别](java/==_equal.md)
31-
* [StringBuffer 和 StringBuilder ](java/stringbuffer__stringbuilder.md)
32-
* [StringBuilder 是什么?](java/stringbuilder.md)
33-
* [是否可以继承 String 类?](java/inherit_string_class.md)
3431
* [所有类的基类是哪个类?](java/what_is_the_base_class_of_all_classes.md)
3532
* [Java 支持多继承吗?](java/does_java_support_multiple_inheritance.md)
3633
* [Path 与 Classpath?](java/what_is_difference_between_path_and_classpath.md)
@@ -55,7 +52,7 @@
5552
* [sleep() and wait()](java/sleep_and_wait.md)
5653
* [Gabage Collection](java/gabage_collection.md)
5754
* [heap 和 stack](java/heap_stack.md)
58-
* [Does garbage collection guarantee that a program will not run out of memory?](java/does_garbage_collection_guarantee_that_a_program_will_not_run_out_of_memory.md)
55+
* [GC 就一定能保证内存不溢出吗?](java/does_garbage_collection_guarantee_that_a_program_will_not_run_out_of_memory.md)
5956
* [字节流与字符流](java/stream_writer.md)
6057
* [Connection](java/connection.md)
6158
* [ArrayList 和 Vector](java/arraylist_vector.md)
@@ -66,17 +63,17 @@
6663
* [同步 synchronized](java/synchronized.md)
6764
* [如何实现 muliti-thread?](java/how_to_set_muliti-thread.md)
6865
* [transient](java/transient.md)
69-
* [What is the difference between preemptive scheduling and time slicing?](java/what_is_the_difference_between_preemptive_scheduling_and_time_slicing.md)
70-
* [When a thread is created and started, what is its initial state?](java/when_a_thread_is_created_and_started,_what_is_its_initial_state.md)
66+
* [preemptive scheduling time slicing?](java/what_is_the_difference_between_preemptive_scheduling_and_time_slicing.md)
67+
* [一个线程的初始状态是什么?](java/when_a_thread_is_created_and_started,_what_is_its_initial_state.md)
7168
* [What are synchronized methods and synchronized statements?](java/what_are_synchronized_methods_and_synchronized_statements.md)
72-
* [What is daemon thread and which method is used to create the daemon thread?](java/what_is_daemon_thread_and_which_method_is_used_to_create_the_daemon_thread.md)
73-
* [What method must be implemented by all threads?](java/what_method_must_be_implemented_by_all_threads.md)
69+
* [守护线程 daemon thread?](java/what_is_daemon_thread_and_which_method_is_used_to_create_the_daemon_thread.md)
70+
* [所有的线程都必须实现哪个方法?](java/what_method_must_be_implemented_by_all_threads.md)
7471
* [Visitor Pattern](java/visitor_pattern.md)
7572
* [Problème sur chaîne](java/probleme_sur_chaine.md)
7673
* [字符串基础问题](java/string_questions.md)
7774
* [StringBuffer 相关问题](java/stringbuffer_questions.md)
7875
* [数组相关问题](java/array.md)
79-
* [serialization](java/serialization.md)
76+
* [序列化 serialization](java/serialization.md)
8077
* [How do I serialize an object to a file?](java/how_do_i_serialize_an_object_to_a_file.md)
8178
* [Which methods of Serializable interface should I implement?](java/which_methods_of_serializable_interface_should_i_implement.md)
8279
* [如何控制 serialization 的过程?](java/how_can_i_customize_the_seralization_process_ie_how_can_one_have_a_control_over_the_serialization_process.md)

java/arraylist_vector.md

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,8 @@
99
ArrayList与Vector的区别
1010

1111
* Vector是线程安全的,
12-
也就是说是它的方法之间是线程同步的,
13-
而ArrayList是线程序不安全的,
14-
它的方法之间是线程不同步的.
15-
如果只有一个线程会访问到集合,那最好是使用ArrayList,
16-
因为它不考虑线程安全,
17-
效率会高些;如果有多个线程会访问到集合,
18-
那最好是使用Vector,
19-
因为不需要我们自己再去考虑和编写线程安全的代码.
12+
也就是线程同步的,
13+
而ArrayList是线程序不安全的.
2014
对于Vector&ArrayList,
2115
Hashtable&HashMap,
2216
要记住线程安全的问题,
@@ -34,5 +28,5 @@ Vector默认增长为原来两倍,而ArrayList的增长策略在文档中没有
3428
Vector还可以设置增长的空间大小,
3529
而ArrayList没有提供设置增长空间的方法.
3630

37-
总结:即Vector增长原来的一倍,ArrayList增加原来的0.5倍. Vector 线程安全, ArrayList 不是.
31+
**总结:即Vector增长原来的一倍,ArrayList增加原来的0.5倍. Vector 线程安全, ArrayList 不是.**
3832

java/does_garbage_collection_guarantee_that_a_program_will_not_run_out_of_memory.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Does garbage collection guarantee that a program will not run out of memory?
1+
# GC 就一定能保证内存不溢出吗?
22

33
Non.
44
程序员可能创建了一个对象,

java/gabage_collection.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
**什么是GC**
44

5-
GC是垃圾收集的意思Gabage Collection,
5+
GC是垃圾收集的意思(Gabage Collection),
66
内存处理是编程人员容易出现问题的地方,
77
忘记或者错误的内存回收会导致程序或系统的不稳定甚至崩溃,
88
Java提供的GC功能可以自动监测对象是否超过作用域从而达到自动回收内存的目的,
@@ -15,4 +15,4 @@ Java语言没有提供释放已分配内存的显示操作方法.
1515

1616
**有什么办法主动通知虚拟机进行垃圾回收?**
1717

18-
可以.程序员可以手动执行System.gc(),通知GC运行,但是Java语言规范并不保证GC一定会执行.
18+
可以.程序员可以手动执行System.gc(),通知GC运行,但是Java语言规范并不保证GC一定会执行. 这个选择题的时候有考.

java/serialization.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# serialization
1+
# 序列化 serialization
22

33
Serialization is a mechanism by which you can save the state of an object by converting it to a byte stream.
44

java/stringbuffer_questions.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,12 @@
88
* 当需要保证线程安全的时候用 StringBuffer
99
* StringBuffer 是 synchronized, StringBuilder 不是.
1010

11-
**题目二**
11+
String 类一般被认为是不可改变的.
12+
如果需要对一个String做许多修改就需要使用StringBuffer或者StringBuilder.
13+
14+
在Oracle里的定义就是
15+
"A mutable sequence of characters."
16+
17+
另外需要注意 String 类是 final 类不可以被继承. 有时候会在考察 final 关键字的时候考这个.
18+
19+

java/transient.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,7 @@
11
# transient
2+
3+
当持久化对象时,
4+
可能有一个特殊的对象数据成员,
5+
我们不想用 serialization 机制来保存它. 为了在一个特定对象的一个域上关闭serialization,
6+
可以在这个域前加上关键字transient.
7+
Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,21 @@
1-
# What is daemon thread and which method is used to create the daemon thread?
1+
# 守护线程 daemon thread?
22

3-
Daemon thread is a low priority thread which runs intermittently in the back ground doing the garbage collection operation for the java runtime system.
3+
守护线程,
4+
是指在程序运行的时候在后台提供一种通用服务的线程,
5+
比如垃圾回收线程就是一个很称职的守护者,
6+
并且这种线程并不属于程序中不可或缺的部分.
7+
因此,
8+
当所有的非守护线程结束时,
9+
程序也就终止了,
10+
同时会杀死进程中的所有守护线程.
11+
反过来说,
12+
只要任何非守护线程还在运行,
13+
程序就不会终止.
14+
15+
用户线程和守护线程两者几乎没有区别,
16+
唯一的不同之处就在于虚拟机的离开:
17+
如果用户线程已经全部退出运行了,
18+
只剩下守护线程存在了,
19+
虚拟机也就退出了.
20+
21+
将线程转换为守护线程可以通过调用Thread对象的setDaemon(true)方法来实现.
Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1-
# What is the difference between preemptive scheduling and time slicing?
1+
# preemptive scheduling time slicing?
22

3-
Under preemptive scheduling, the highest priority task executes until it enters the waiting or dead states or a higher priority task comes into existence. Under time slicing, a task executes for a predefined slice of time and then reenters the pool of ready tasks. The scheduler then determines which task should execute next, based on priority and other factors.
3+
preemptive scheduling,
4+
优先级别最高的任务会被执行,
5+
除非它进入等待状态或者死了或者一个更高优先权的任务进来.
6+
7+
time slicing,
8+
a task executes for a predefined slice of time and then reenters the pool of ready tasks. The scheduler then determines which task should execute next, based on priority and other factors.

0 commit comments

Comments
 (0)