this
关键字有以下用途:
this
可用于引用当前类实例变量。this
可用于调用当前类方法(隐式)。this()
可用于调用当前类的构造函数。this
可以作为方法调用中的参数传递。this
可以在构造函数调用中作为参数传递。this
可用于从方法返回当前类实例。
53、this
关键字的主要用途是什么?
this
关键字有以下用途:
this
可用于引用当前类实例变量。this
可用于调用当前类方法(隐式)。this()
可用于调用当前类的构造函数。this
可以作为方法调用中的参数传递。this
可以在构造函数调用中作为参数传递。this
可用于从方法返回当前类实例。