Technically String is not a wrapper class,because there is no corresponding primitive type 是最近在hao to Think like a computer scientist 中看到了这能不能说明他不是基本类型呢?
搬出Java虚拟机规范的描述:
The primitive data types supported by the Java Virtual Machine are the numeric types, the boolean type (§2.3.4), and the returnAddress type (§2.3.3).
The numeric types consist of the integral types (§2.3.1) and the floating-point types (§2.3.2).
因此基本数据类型就是:
integral types , floating-point types , boolean type 和returnAddress type
至于有些脑残的面试官要是问为什么String不是基本数据类型,就搬这句话出来吧。。。