Skip to content

Commit

Permalink
修复bug:char在Java中应该占两个字节 (感谢issue提醒!)
Browse files Browse the repository at this point in the history
  • Loading branch information
Snailclimb authored Sep 15, 2018
1 parent d7789b0 commit 7f922cb
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion Java相关/Java基础知识.md
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,10 @@ Java 语言通过字节码的方式,在一定程度上解决了传统解释型

1. 形式上: 字符常量是单引号引起的一个字符 字符串常量是双引号引起的若干个字符
2. 含义上: 字符常量相当于一个整形值( ASCII 值),可以参加表达式运算 字符串常量代表一个地址值(该字符串在内存中存放位置)
3. 占内存大小 字符常量只占一个字节 字符串常量占若干个字节(至少一个字符结束标志)
3. 占内存大小 字符常量只占2个字节 字符串常量占若干个字节(至少一个字符结束标志) (**注意: char在Java中占两个字节**)

> java编程思想第四版:2.2.2节
![](http://my-blog-to-use.oss-cn-beijing.aliyuncs.com/18-9-15/86735519.jpg)

## 9. 构造器 Constructor 是否可被 override

Expand Down

0 comments on commit 7f922cb

Please sign in to comment.