码迷,mamicode.com
首页 > 编程语言 > 详细

java this

时间:2016-08-05 19:44:15      阅读:245      评论:0      收藏:0      [点我收藏+]

标签:

this 代表什么

this 应用场景

 

When used as a primary expression, the keyword this denotes a value that is a reference to the object for which the instance method or default method was invoked , or to the object being constructed. The value denoted by this in a lambda body is the same as the value denoted by this in the surrounding context.

注意点:

this 是对象的引用

 

 

The keyword this may be used only in the following contexts:

  •  in the body of an instance method or default method

  •  in the body of a constructor of a class 

  •  in an instance initializer of a class

  •  in the initializer of an instance variable of a class

  •  to denote a receiver parameter

 

java this

标签:

原文地址:http://www.cnblogs.com/zno2/p/5611296.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!