文字定义 (Java)
Definition of literal (Java)
根据 JLS 3.10
https://docs.oracle.com/javase/specs/jls/se12/jls12.pdf
A literal is the source code representation of a value of a primitive
type (§4.2), the String type (§4.3.3), or the null type (§4.1).
Class 对象文字呢?或数组字面量?等等
它们不一样。 §15.8 明确区分词法文字和 class 文字。并且没有数组文字的正式概念。
根据 JLS 3.10 https://docs.oracle.com/javase/specs/jls/se12/jls12.pdf
A literal is the source code representation of a value of a primitive type (§4.2), the String type (§4.3.3), or the null type (§4.1).
Class 对象文字呢?或数组字面量?等等
它们不一样。 §15.8 明确区分词法文字和 class 文字。并且没有数组文字的正式概念。