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的更多相关文章

  1. Chapter 6. Names

    6.2. Names and Identifiers A name is used to refer to an entity declared in a program. There are two ...

  2. bluetooth service uuid

    转自:https://www.bluetooth.com/specifications/assigned-numbers/service-discovery service discovery ​​​ ...

  3. IE6 IE7 IE8 的函数声明和函数表达式的实现与其他浏览器有差异

    标准参考 函数声明和函数表达式 定义一个函数有两种途径:函数声明和函数表达式. 函数声明: function Identifier ( FormalParameterList opt ) { Func ...

  4. esriFeatureType与esriGeometryType的区别与联系

    esriFeatureType通常用来表示数据的存储结构,即物理层: esriGeometryType通常用来表示数据的几何形状,即表现层. esriGeometryType枚举类型详解 常量 值 对 ...

  5. Using the EventManager

    Using the EventManager This tutorial explores the features of zend-eventmanager in-depth. Terminolog ...

  6. python27读书笔记0.1

    --Notes: 测试环境:Windows ,python 2.7.3,python 自带的IDLE #-*- coding: utf-8 -*- # First Lesson# --- Line s ...

  7. Bayeux协议

    Bayeux 协议-- Bayeux 1.0草案1 本备忘录状态 This document specifies a protocol for the Internet community, and ...

  8. The Go Programming Language. Notes.

    Contents Tutorial Hello, World Command-Line Arguments Finding Duplicate Lines A Web Server Loose End ...

  9. 像职业选手样编码:地道Python

    Code Like a Pythonista: Idiomatic Python David Goodger goodger@python.org http://python.net/~goodger ...

随机推荐

  1. BUG_vector iterator not dereferencable

    1问题: bug提示图下图所示:

  2. Node.js最新Web技术栈(2015年5月)

    https://cnodejs.org/topic/55651bf07d4c64752effb4b1

  3. cocos studio

    用了几天,和之前用的cocos creator以及unity的编辑器一对比,很多地方都挺反人类的哈... 拖拽和放大场景元素竟然还要切换一下编辑模式... 移动场景元素竟然没有单独控制x或者y方向的移 ...

  4. C++显式转换

    标准C++包含一个显式的转换语法: --static_cast:用于“良性”和“适度良性”的转换,包括不用强制转换 --const_cast:用于“const”和/或“volatile”进行转换 -- ...

  5. Android sdcard文件读写操作

    这次演示以,安卓原生操作系统 Nexus_6手机进行操作: AndroidManifest.xml配置相关权限: <!-- 增加权限 --> <uses-permission and ...

  6. Linux测试上行和下载速率

    下载安装speedtest-cli测试工具 方法一: pip3 install speedtest-cli 方法二: wget https://github.com/sivel/speedtest-c ...

  7. EF添加Msysql实体异常:表“TableDetails”中列“IsPrimaryKey”的值为 DBNull。 ---> System.InvalidCastException: 指定的转换无效。

    尝试一下以下步骤: 1.关闭VS项目, 以管理员权限来打开: 1.执行语句 set global optimizer_switch='derived_merge=OFF'; set optimizer ...

  8. NetCore入门篇:(五)Net Core项目使用静态文件

    一.简介 1.Net Core默认无法访问静态文件,需要在Startup通过代码添加定义. 2.本文介绍两种静态文件目录实现方式. 二.启用默认目录 1.添加图片文件 2.测试访问结果(不能访问) 3 ...

  9. s11 day104 数据库表结构与立即支付流程

    数据库表结构: 13张 1. 课程大类 2.课程子类 3.学位课程 4.老师表 5.奖学金 6.专题课 7.课程详情 8.课程大纲 9.常见问题 10.章节 11.课时 12.作业表 13.价格策略 ...

  10. MySQL数据库命令大全

    --数据库操作前的准备-- 创建数据库-- create database python_test_1 charset=utf8; -- 使用数据库-- use python_test_1; -- s ...