首页 > 编程语言 > 详细

java this

时间:2016-08-05 19:42:04      阅读:148      评论: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
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!