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 ...
随机推荐
- Win窗口坐标二维坐标与OpenGl的世界坐标系的之间的相互转换
Win窗口坐标二维坐标与OpenGl的世界坐标系的转换 几何处理管线擅长于使用视图和投影矩阵以及用于裁剪的视口把顶点的世界坐标变换为窗口坐标. 但是,在有些情况下,需要逆转这个过程.一种常见的情形是: ...
- Media Queries简单案例一
案例一: 1 <!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" ...
- 执行Docker命令报错解决办法
shim error: docker-runc not installed on system 服务器重启以后,执行docker命令报以上错误,解决办法如下: cd /usr/libexec/do ...
- VSTS 更名为 Azure DevOps
微软正式对外宣布Azure DevOps,其实就是原来的VSTS,我们来看一下Azure DevOps的介绍: 今天我们宣布Azure DevOps.与世界各地的客户和开发人员合作,很明显,DevOp ...
- python 查找字符串同时包含数字和字母的最长子字符串的几种实现方法
有个字符串$sd1#111$svda123!!!221&eSSDSDG,包含特殊字符.数字和字母,输出最长的子字符串和他的长度 例如上面的字符串同时包含数字和字母的字符串是svda123,长度 ...
- leetcode 最后一个单词的长度
给定一个仅包含大小写字母和空格 ' ' 的字符串,返回其最后一个单词的长度. 如果不存在最后一个单词,请返回 0 . 说明:一个单词是指由字母组成,但不包含任何空格的字符串. 示例: 输入: &quo ...
- VS未能正确加载 ”Microsoft.VisualStudio.Editor.Implementation.EditorPackate“包错误解决方法
很久没用VS了,打开后出现未能正确加载 ”Microsoft.VisualStudio.Editor.Implementation.EditorPackate“包的错误,经过一番上网查阅错误得以解决. ...
- C#操作字符串之常用函数总结
1:使用string.Join 泛型集合快速转换拼接字符串. 2:使用 string.Split 将字符串截断转换成字符数组. 3:使用 string.Substring,string.Remove ...
- Day 9 函数的初识1
def my_len(): l1 = [1,2,3,5,6] print(111) print(222) return print(333)print(my_len()) 一.函数的定义1.遇到ret ...
- CentOS IPv6设置
1)/etc/sysconfig/network 打开/关闭网络配置 添加: NETWORKING_IPV6=yes 打开IPv6 IPV6_AUTOCONF=no 如果不喜欢自动获 ...