Skip to content

Commit

Permalink
修改说法,避免歧义
Browse files Browse the repository at this point in the history
  • Loading branch information
qiaoxingxing committed Jan 5, 2024
1 parent 6dfc8b1 commit 2927fa2
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion docs/java/basis/syntactic-sugar.md
Original file line number Diff line number Diff line change
Expand Up @@ -758,7 +758,8 @@ class GT<T>{

以上代码输出结果为:2!

由于经过类型擦除,所有的泛型类实例都关联到同一份字节码上,泛型类的所有静态变量是共享的。
有些同学可能会误认为泛型类是不同的类,对应不同的字节码,其实
由于经过类型擦除,所有的泛型类实例都关联到同一份字节码上,泛型类的静态变量是共享的。上面例子里的`GT<Integer>.var``GT<String>.var`其实是一个变量。

### 自动装箱与拆箱

Expand Down

0 comments on commit 2927fa2

Please sign in to comment.