Names and Identifiers
JLS:https://docs.oracle.com/javase/specs/jls/se7/html/jls-6.html#jls-6.2
Not all identifiers in a program are a part of a name. Identifiers are also used in the following situations:
(1)In declarations (§6.1), where an identifier may occur to specify the name by which the declared entity will be known.
(2)As labels in labeled statements (§14.7) and in break andcontinue statements (§14.15, §14.16) that refer to statement labels.
(3)In field access expressions (§15.11), where an identifier occurs after a "." token to indicate a member of an object that is the value of an expression or the keyword super that appears before the "." token
(4)In some method invocation expressions (§15.12), where an identifier may occur after a "." token and before a "(" token to indicate a method to be invoked for an object that is the value of an expression or the keyword super that appears before the "." token
(5)In qualified class instance creation expressions (§15.9), where an identifier occurs immediately to the right of the leftmost new token to indicate a type that must be a member of the compile-time type of the primary expression preceding the "." preceding the leftmost new token.
1、Primary Expressions
Primary:
PrimaryNoNewArray
ArrayCreationExpression
PrimaryNoNewArray:
Literal
Type . class
void . class
this
ClassName . this
( Expression )
ClassInstanceCreationExpression
FieldAccess
MethodInvocation
ArrayAccess
15.8.1. Lexical Literals
Literal:
IntegerLiteral
FloatingPointLiteral
BooleanLiteral
CharacterLiteral
StringLiteral
NullLiteral
15.8.2. Class Literals
class TC<T>{
public void test(){
//Object t = T.class; // error
Class<ArrayList> l = ArrayList.class;
// Class<ArrayList> l = ArrayList<String>.class; // error
Class<Integer> o = int.class;
Class<Void> v = void.class;
}
}
15.8.3. this
15.8.4. Qualified this
15.8.5. Parenthesized Expressions
2、Field Access Expressions
FieldAccess:
Primary . Identifier
super . Identifier
ClassName . super . Identifier
3、Method Invocation Expressions
MethodInvocation:
MethodName ( ArgumentListopt )
Primary . NonWildTypeArgumentsopt Identifier ( ArgumentListopt )
super . NonWildTypeArgumentsopt Identifier ( ArgumentListopt )
ClassName . super . NonWildTypeArgumentsopt Identifier ( ArgumentListopt )
TypeName . NonWildTypeArguments Identifier ( ArgumentListopt )
3.1、ArgumentList
ArgumentList:
Expression
ArgumentList , Expression
4、Class Instance Creation Expressions
ClassInstanceCreationExpression:
new TypeArgumentsopt TypeDeclSpecifier TypeArgumentsOrDiamondopt
( ArgumentListopt ) ClassBodyopt
Primary . new TypeArgumentsopt Identifier TypeArgumentsOrDiamondopt
( ArgumentListopt ) ClassBodyopt
TypeArgumentsOrDiamond:
TypeArguments
<>
ArgumentList:
Expression
ArgumentList , Expression
Names and Identifiers的更多相关文章
- Chapter 6. Names
6.2. Names and Identifiers A name is used to refer to an entity declared in a program. There are two ...
- bluetooth service uuid
转自:https://www.bluetooth.com/specifications/assigned-numbers/service-discovery service discovery ...
- IE6 IE7 IE8 的函数声明和函数表达式的实现与其他浏览器有差异
标准参考 函数声明和函数表达式 定义一个函数有两种途径:函数声明和函数表达式. 函数声明: function Identifier ( FormalParameterList opt ) { Func ...
- esriFeatureType与esriGeometryType的区别与联系
esriFeatureType通常用来表示数据的存储结构,即物理层: esriGeometryType通常用来表示数据的几何形状,即表现层. esriGeometryType枚举类型详解 常量 值 对 ...
- Using the EventManager
Using the EventManager This tutorial explores the features of zend-eventmanager in-depth. Terminolog ...
- python27读书笔记0.1
--Notes: 测试环境:Windows ,python 2.7.3,python 自带的IDLE #-*- coding: utf-8 -*- # First Lesson# --- Line s ...
- Bayeux协议
Bayeux 协议-- Bayeux 1.0草案1 本备忘录状态 This document specifies a protocol for the Internet community, and ...
- The Go Programming Language. Notes.
Contents Tutorial Hello, World Command-Line Arguments Finding Duplicate Lines A Web Server Loose End ...
- 像职业选手样编码:地道Python
Code Like a Pythonista: Idiomatic Python David Goodger goodger@python.org http://python.net/~goodger ...
随机推荐
- 几个经典的数学库之一学习---VCGlib(3)
Camera and shot abstraction for managing views 视图的定义,以及mesh的操作说明. Shot(镜头) and camera(相机) shot摄像结构以及 ...
- springmvc 孔浩 hibernate
以上为项目文件 用到的jar包:http://pan.baidu.com/s/1kT1Rsqj 1. model-User 2. beans.xml-去哪些包中找annotation:查找相应的实体类 ...
- Asp.net Core2.0, 基于 claims 实现权限验证
https://www.cnblogs.com/KimmyLee/p/6430474.html
- linux系统编程之信号(四):alarm和可重入函数
一,alarm() 在将可重入函数之前我们先来了解下alarm()函数使用: #include <unistd.h> unsigned int alarm(unsigned int sec ...
- linux系统编程之进程(一):进程与程序
本节目标: 什么是程序 什么是进程 进程数据结构 进程与程序区别与联系 一,什么是程序? 程序是完成特定任务的一系列指令集合 二,什么是进程? 从用户的角度来看进程是程序的一次动态执行过程 从操作系统 ...
- ASP.NET Core 2 学习笔记(二)生命周期
要了解程序的运行原理,就要先知道程序的进入点及生命周期.以往ASP.NET MVC的启动方式,是继承 HttpApplication 作为网站开始的进入点,而ASP.NET Core 改变了网站的启动 ...
- 【打印机】argox入门
立象dx4300打印机调试. 1 环境搭建 1.1 下载软件 登录 http://www.argox.com.cn/Pages/servicedownload.aspx 下载驱动和手册. 1.2 正常 ...
- MPU6050学习笔记(电源管理器1、2)
Technorati Tags: 嵌入式开发.模块开发 寄存器107号:电源管理器1 PWR_MGMT_1: Description: This register allows the user to ...
- 利用MVC5+EF6搭建博客系统
https://www.cnblogs.com/wyt007/p/7880137.html
- Sql语法高级应用之七:如何在存储过程中使用事务
普通事物: USE Wot_Inventory; GO BEGIN TRANSACTION tr; DECLARE @error INT; SET @error = 0; SELECT * FROM ...