CS-Notes/notes/Java 基础语法.md

141 lines
4.0 KiB
Markdown
Raw Normal View History

2018-02-20 10:40:05 +08:00
<!-- GFM-TOC -->
* [<EFBFBD><EFBFBD><EFBFBD><EFBFBD>](#<23><><EFBFBD><EFBFBD>)
* [ final](#-final)
* [<EFBFBD><EFBFBD>ʼ<EFBFBD><EFBFBD>˳<EFBFBD><EFBFBD>](#<23><>ʼ<EFBFBD><CABC>˳<EFBFBD><CBB3>)
* [<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ȩ<EFBFBD><EFBFBD>](#<23><><EFBFBD><EFBFBD>Ȩ<EFBFBD><C8A8>)
* [<EFBFBD><EFBFBD><EFBFBD><EFBFBD>](#<23><><EFBFBD><EFBFBD>)
* [Set](#set)
* [Queue](#queue)
* [Map](#map)
* [<EFBFBD><EFBFBD><EFBFBD><EFBFBD>](#<23><><EFBFBD><EFBFBD>)
* [<EFBFBD>](#<23>)
* [<EFBFBD>ο<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>](#<23>ο<EFBFBD><CEBF><EFBFBD><EFBFBD><EFBFBD>)
<!-- GFM-TOC -->
# <20><><EFBFBD><EFBFBD>
## final
**final <20><><EFBFBD><EFBFBD>**
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>DZ<EFBFBD><EFBFBD><EFBFBD>ʱ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ҳ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʼ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ܱ<EFBFBD><EFBFBD>ı<EFBFBD><EFBFBD>ij<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
<EFBFBD><EFBFBD><EFBFBD>ڻ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͣ<EFBFBD>final ʹ<><CAB9>ֵ<EFBFBD><D6B5><EFBFBD><EFBFBD><E4A3BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ö<EFBFBD><C3B6><EFBFBD><EFBFBD><EFBFBD>final ʹ<><CAB9><EFBFBD>ò<EFBFBD><C3B2>䣬Ҳ<E4A3AC>Ͳ<EFBFBD><CDB2><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>󣬵<EFBFBD><F3A3ACB5>DZ<EFBFBD><C7B1><EFBFBD><EFBFBD>õĶ<C3B5><C4B6><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ǿ<EFBFBD><C7BF><EFBFBD><EFBFBD>޸ĵġ<C4B5>
**final <20><><EFBFBD><EFBFBD>**
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ܱ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ǡ<EFBFBD>
private <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʽ<EFBFBD>ر<EFBFBD>ָ<EFBFBD><D6B8>Ϊ final<61><6C><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ж<EFBFBD><D0B6><EFBFBD><EFBFBD>ķ<EFBFBD><C4B7><EFBFBD><EFBFBD>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD>е<EFBFBD>һ<EFBFBD><D2BB> private <20><><EFBFBD><EFBFBD>ǩ<EFBFBD><C7A9><EFBFBD><EFBFBD>ͬ<EFBFBD><CDAC><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD><EFBFBD><EFBFBD>ķ<EFBFBD><C4B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ǹ<EFBFBD><C7B8>ǻ<EFBFBD><C7BB><EFBFBD><E0B7BD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ˡ<EFBFBD>
**final <20><>**
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>̳С<EFBFBD>
## <20><>ʼ<EFBFBD><CABC>˳<EFBFBD><CBB3>
static <20><><EFBFBD><EFBFBD><EFBFBD>ľ<EFBFBD>̬<EFBFBD><CCAC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڴ<EFBFBD><DAB4><EFBFBD>ֻ<EFBFBD><D6BB><EFBFBD><EFBFBD>һ<EFBFBD>ݣ<EFBFBD>ֻ<EFBFBD><D6BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD>һ<EFBFBD><D2BB>ʵ<EFBFBD><CAB5><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1>ʼ<EFBFBD><CABC>һ<EFBFBD>Σ<EFBFBD><CEA3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݵij<DDB5>ʼ<EFBFBD><CABC><EFBFBD><EFBFBD>
```java
public static String staticField = "<22><>̬<EFBFBD><CCAC><EFBFBD><EFBFBD>";
```
static <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> static <20><><EFBFBD><EFBFBD>һ<EFBFBD><D2BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>һ<EFBFBD><D2BB>ʵ<EFBFBD><CAB5><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD><EFBFBD>һ<EFBFBD>Σ<EFBFBD><CEA3><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ĸ<EFBFBD><C4B8><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ȡ<EFBFBD><C8A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڴ<EFBFBD><DAB4><EFBFBD><EFBFBD>е<EFBFBD>˳<EFBFBD><CBB3><EFBFBD><EFBFBD>
```java
static {
System.out.println("<22><>̬<EFBFBD><CCAC>ʼ<EFBFBD><CABC><EFBFBD><EFBFBD>");
}
```
<EFBFBD><EFBFBD>ͨ<EFBFBD><EFBFBD><EFBFBD>ݺ<EFBFBD><EFBFBD><EFBFBD>ͨ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ij<EFBFBD>ʼ<EFBFBD><EFBFBD><EFBFBD>ھ<EFBFBD>̬<EFBFBD><EFBFBD><EFBFBD>ݺ;<EFBFBD>̬<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʼ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>֮<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
```java
public String field = "<22><><EFBFBD><EFBFBD>";
```
```java
{
System.out.println("<22><>ʼ<EFBFBD><CABC><EFBFBD><EFBFBD>");
}
```
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ǹ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>е<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݽ<EFBFBD><EFBFBD>г<EFBFBD>ʼ<EFBFBD><EFBFBD>
```java
public InitialOrderTest()
{
System.out.println("<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
}
```
<EFBFBD><EFBFBD><EFBFBD>ڼ̳е<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>£<EFBFBD><EFBFBD><EFBFBD>ʼ<EFBFBD><EFBFBD>˳<EFBFBD><EFBFBD>Ϊ<EFBFBD><EFBFBD>
1. <20><><EFBFBD><EFBFBD><E0A3A8>̬<EFBFBD><CCAC><EFBFBD>ݡ<EFBFBD><DDA1><EFBFBD>̬<EFBFBD><CCAC><EFBFBD><EFBFBD><EFBFBD>
2. <20><><EFBFBD><EFBFBD><E0A3A8>̬<EFBFBD><CCAC><EFBFBD>ݡ<EFBFBD><DDA1><EFBFBD>̬<EFBFBD><CCAC><EFBFBD><EFBFBD><EFBFBD>
3. <20><><EFBFBD><EFBFBD><E0A3A8><EFBFBD>ݡ<EFBFBD><DDA1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
4. <20><><EFBFBD><EFBFBD><E0A3A8><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
5. <20><><EFBFBD><EFBFBD><E0A3A8><EFBFBD>ݡ<EFBFBD><DDA1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
6. <20><><EFBFBD><EFBFBD><E0A3A8><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
## <20><><EFBFBD><EFBFBD>Ȩ<EFBFBD><C8A8>
Java <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ȩ<EFBFBD><C8A8><EFBFBD><EFBFBD><EFBFBD>η<EFBFBD><CEB7><EFBFBD>private<74><65>protected <20>Լ<EFBFBD> public<69><63><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ӷ<EFBFBD><D3B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD>η<EFBFBD><CEB7><EFBFBD><EFBFBD><EFBFBD>ʾ<EFBFBD><CABE><EFBFBD><EFBFBD><EFBFBD>ɼ<EFBFBD><C9BC><EFBFBD>
<EFBFBD><EFBFBD><EFBFBD>Զ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>еij<EFBFBD>Ա<EFBFBD><EFBFBD><EFBFBD>ֶ<EFBFBD><EFBFBD>Լ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϸ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>η<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ա<EFBFBD>ɼ<EFBFBD><EFBFBD><EFBFBD>ʾ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ó<EFBFBD>Ա<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ķ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʵ<EFBFBD><EFBFBD>ó<EFBFBD>Ա<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɼ<EFBFBD><EFBFBD><EFBFBD>ʾ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>󣬿<EFBFBD><EFBFBD>԰<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>е<EFBFBD>һ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ա<EFBFBD><EFBFBD>Ȼ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʾһ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͺ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ˡ<EFBFBD>
protected <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>γ<EFBFBD>Ա<EFBFBD><D4B1><EFBFBD><EFBFBD>ʾ<EFBFBD>ڼ̳<DABC><CCB3><EFBFBD>ϵ<EFBFBD>г<EFBFBD>Ա<EFBFBD><D4B1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɼ<EFBFBD><C9BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>η<EFBFBD><CEB7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>û<EFBFBD><C3BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><E5A3AC>Ϊ<EFBFBD><CEAA>û<EFBFBD>м̳<D0BC><CCB3><EFBFBD>ϵ<EFBFBD><CFB5>
# <20><><EFBFBD><EFBFBD>
![](https://github.com/CyC2018/InterviewNotes/blob/master/pics/114c49a6-72e3-4264-ae07-c564127094ac.png)
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ҫ<EFBFBD><EFBFBD><EFBFBD><EFBFBD> Collection <20><> Map <20><><EFBFBD>֣<EFBFBD>Collection <20>ְ<EFBFBD><D6B0><EFBFBD><EFBFBD><EFBFBD> List<73><74>Set <20>Լ<EFBFBD> Queue<75><65>
## Set
- HashSet<65><74>ʹ<EFBFBD><CAB9> Hash ʵ<>֣<EFBFBD>֧<EFBFBD>ֿ<EFBFBD><D6BF>ٲ<EFBFBD><D9B2>ң<EFBFBD><D2A3><EFBFBD><EFBFBD><EFBFBD>ʧȥ<CAA7><C8A5><EFBFBD><EFBFBD><EFBFBD>ԣ<EFBFBD>
- TreeSet<65><74>ʹ<EFBFBD><CAB9><EFBFBD><EFBFBD>ʵ<EFBFBD>֣<EFBFBD><D6A3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>򣬵<EFBFBD><F2A3ACB5>Dz<EFBFBD><C7B2><EFBFBD>Ч<EFBFBD>ʲ<EFBFBD><CAB2><EFBFBD> HashSet<65><74>
- LinkedListHashSet<65><74><EFBFBD><EFBFBD><EFBFBD><EFBFBD> HashSet <20>IJ<EFBFBD><C4B2><EFBFBD>Ч<EFBFBD>ʣ<EFBFBD><CAA3><EFBFBD><EFBFBD>ڲ<EFBFBD>ʹ<EFBFBD><CAB9><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ά<EFBFBD><CEAC>Ԫ<EFBFBD>صIJ<D8B5><C4B2><EFBFBD>˳<EFBFBD><CBB3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˾<EFBFBD><CBBE><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ԡ<EFBFBD>
## Queue
ֻ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʵ<EFBFBD>֣<EFBFBD>LinkedList <20><> PriorityQueue<75><65><EFBFBD><EFBFBD><EFBFBD><EFBFBD> LinkedList ֧<><D6A7>˫<EFBFBD><CBAB><EFBFBD><EFBFBD><EFBFBD>С<EFBFBD>
## Map
- HashMap<61><70>ʹ<EFBFBD><CAB9> Hash ʵ<><CAB5>
- LinkedHashMap<61><70><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˳<EFBFBD><CBB3>Ϊ<EFBFBD><CEAA><EFBFBD><EFBFBD>˳<EFBFBD><CBB3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʹ<EFBFBD>ã<EFBFBD>LRU<52><55>˳<EFBFBD><CBB3>
- TreeMap<61><70><EFBFBD><EFBFBD><EFBFBD>ں<EFBFBD><DABA><EFBFBD><EFBFBD><EFBFBD>ʵ<EFBFBD><CAB5>
- ConcurrentHashMap<61><70><EFBFBD>̰߳<DFB3>ȫ Map<61><70><EFBFBD><EFBFBD><EFBFBD>漰ͬ<E6BCB0><CDAC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
# <20><><EFBFBD><EFBFBD>
ÿ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>һ<EFBFBD><EFBFBD> **Class** <20><><EFBFBD>󣬰<EFBFBD><F3A3ACB0><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>йص<D0B9><D8B5><EFBFBD>Ϣ<EFBFBD><CFA2><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>һ<EFBFBD><D2BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>һ<EFBFBD><D2BB>ͬ<EFBFBD><CDAC><EFBFBD><EFBFBD> .class <20>ļ<EFBFBD><C4BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD><C4BC><EFBFBD><EFBFBD>ݱ<EFBFBD><DDB1><EFBFBD><EFBFBD><EFBFBD> Class <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> Class <20><><EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD><C4BC>ء<EFBFBD><D8A1><EFBFBD><EFBFBD>ڵ<EFBFBD>һ<EFBFBD><D2BB>ʹ<EFBFBD><CAB9>ʱ<EFBFBD>Ŷ<EFBFBD>̬<EFBFBD><CCAC><EFBFBD>ص<EFBFBD> JVM <20>У<EFBFBD><D0A3><EFBFBD><EFBFBD><EFBFBD>ʹ<EFBFBD><CAB9> Class.forName('com.mysql.jdbc.Driver.class') <20><><EFBFBD>ַ<EFBFBD>ʽ<EFBFBD><CABD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD><C4BC>أ<EFBFBD><D8A3>÷<EFBFBD><C3B7><EFBFBD><EFBFBD><EFBFBD><E1B7B5>һ<EFBFBD><D2BB> Class <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱ<EFBFBD>ż<EFBFBD><EFBFBD>ؽ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڱ<EFBFBD><EFBFBD><EFBFBD>ʱ<EFBFBD>ڸ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> .class <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ҳ<EFBFBD><D2B2><EFBFBD>Լ<EFBFBD><D4BC>ؽ<EFBFBD><D8BD><EFBFBD><EFBFBD><EFBFBD>
Class <20><> java.lang.reflect һ<><D2BB><EFBFBD>Է<EFBFBD><D4B7><EFBFBD><EFBFBD><EFBFBD><E1B9A9>֧<EFBFBD>֣<EFBFBD>java.lang.reflect <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> **Field**<EFBFBD><EFBFBD>**Method** <20>Լ<EFBFBD> **Constructor** <20><EFBFBD><E0A1A3><EFBFBD><EFBFBD>ʹ<EFBFBD><CAB9> get() <20><> set() <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ȡ<EFBFBD><C8A1><EFBFBD>޸<EFBFBD> Field <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֶΣ<D6B6><CEA3><EFBFBD><EFBFBD><EFBFBD>ʹ<EFBFBD><CAB9> invoke() <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> Method <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ķ<EFBFBD><C4B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> Constructor <20><><EFBFBD><EFBFBD><EFBFBD>µĶ<C2B5><C4B6><EFBFBD><EFBFBD><EFBFBD>
IDE ʹ<>÷<EFBFBD><C3B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ƻ<EFBFBD>ȡ<EFBFBD><C8A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ<EFBFBD><CFA2><EFBFBD><EFBFBD>ʹ<EFBFBD><CAB9>һ<EFBFBD><D2BB><EFBFBD><EFBFBD><EFBFBD>Ķ<EFBFBD><C4B6><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD>ܹ<EFBFBD><DCB9><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֶΡ<D6B6><CEA1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>͹<EFBFBD><CDB9><EFBFBD><ECBAAF><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ<EFBFBD>г<EFBFBD><D0B3><EFBFBD><EFBFBD><EFBFBD><EFBFBD>û<EFBFBD>ѡ<EFBFBD><D1A1><EFBFBD><EFBFBD>
# <20>
Throwable <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʾ<EFBFBD>κο<CEBA><CEBF><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD><EFBFBD>׳<EFBFBD><D7B3><EFBFBD><EFBFBD><EFBFBD><E0A3AC>Ϊ<EFBFBD><CEAA><EFBFBD>֣<EFBFBD>**Error** <20><> **Exception**<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> Error <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʾ<EFBFBD><CABE><EFBFBD><EFBFBD>ʱϵͳ<CFB5><CDB3><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
Exception <20><>Ϊ<EFBFBD><CEAA><EFBFBD>֣<EFBFBD>**<2A>ܼ<EFBFBD><DCBC>쳣** <20><> **<EFBFBD><EFBFBD><EFBFBD>ܼ<EFBFBD><EFBFBD>쳣**<2A><><EFBFBD>ܼ<EFBFBD><DCBC><EFBFBD><ECB3A3>Ҫ<EFBFBD><D2AA> try...catch... <20><><EFBFBD><EFBFBD>񲢽<EFBFBD><F1B2A2BD>д<EFBFBD><D0B4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ҿ<EFBFBD><D2BF>Դ<EFBFBD><D4B4><EFBFBD>лָ<D0BB><D6B8><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ܼ<EFBFBD><DCBC><EFBFBD>dz<EFBFBD><C7B3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 0 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> Arithmetic Exception<6F><6E><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>޷<EFBFBD><DEB7>ָ<EFBFBD><D6B8><EFBFBD>
![](https://github.com/CyC2018/InterviewNotes/blob/master/pics/48f8f98e-8dfd-450d-8b5b-df4688f0d377.jpg)
# <20>ο<EFBFBD><CEBF><EFBFBD><EFBFBD><EFBFBD>
- Eckel B, <20><><EFBFBD>˶<EFBFBD> , <20><><EFBFBD><EFBFBD> , <20><> . Java <20><><EFBFBD><EFBFBD>˼<EFBFBD><CBBC> [M]. <20><>е<EFBFBD><D0B5>ҵ<EFBFBD><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD> , 2002.
- [Java <20><><EFBFBD><EFBFBD>ʼ<EFBFBD><CABC>˳<EFBFBD><CBB3> ](https://segmentfault.com/a/1190000004527951)