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 ...
随机推荐
- Java 容器 LinkedHashMap源码分析1
同 HashMap 一样,LinkedHashMap 也是对 Map 接口的一种基于链表和哈希表的实现.实际上, LinkedHashMap 是 HashMap 的子类,其扩展了 HashMap 增加 ...
- 关于android4.3 bluetooth4.0的那些事儿
马年伊始,刚刚上班的一个星期,公司里没什么事儿可做,只是听说马上可能要做蓝牙的项目.之前也做过关于软硬件通讯之类的项目:android 串口通讯,android usb 转串口通讯. 可是蓝牙这块还真 ...
- 一致性哈希算法和Go语言实现
一致性哈希算法,当我第一次听到这个名字的时候,感觉特别高深.而它往往会和分布式系统相关,准确的说,是分布式缓存. 在Web服务中,缓存是介于数据库和服务端程序之间的一个东西.在网站的业务还不是很大的时 ...
- Mina的ssl加密
前面写的Mina的示例,都是可以通过telnet登录的,并且可以相互交互. 现在采用ssl加密的方式,对建立连接时,进行加密连接.这样,双方只有统一的加密,然后才可以连接. 密钥的生成之前有说过,里面 ...
- C#开发微信小程序
个人见解,欢迎交流,不喜勿喷. 微信小程序相比于微信公众号的开发,区别在于微信小程序只请求第三方的数据,整个界面的交互(view)还是在微信小程序上实现,前后端完全分离,说白了,微信小程序开发与具 ...
- .net core An assembly specified in the application dependencied mainfest<****.json>was not found解决办法
最近在开发项目中,遇到了一个问题.在本机开发中部署到本机iis上或者本机控制台都没有问题,运行正常.当发布部署到服务器(windowsServer)中的时候一直运行不起来,用控制台也运行不起来,直接报 ...
- Sql Server字符串拆分(Split)方法汇总
详细链接:https://shop499704308.taobao.com/?spm=a1z38n.10677092.card.11.594c1debsAGeak--方法0:动态SQL法 declar ...
- Spring 开发第一步(四)Spring与JDBC事务
Spring使用各种不同的TransactionManager来管理各种不同数据源事务底层(比如jdbc数据源.hibernate数据源.JPA数据源等等).在此基础上使用各种对应的Template来 ...
- python 十进制 和 IP 地址互转
#! /bin/python def ip2decimalism(ip): dec_value = 0 v_list = ip.split('.') v_list.reverse() t = 1 fo ...
- Neutron 架构图
与 OpenStack 其他服务一样,Neutron 采用的是分布式架构,包括 Neutorn Server.各种 plugin/agent.database 和 message queue. Neu ...