This的用法
来源:互联网 发布:淘宝主图视频制作工具 编辑:程序博客网 时间:2024/05/24 03:11
一:类中的方法中的参数名和该类的成员变量名相同,而函数需要对成员变量进行操作
class person
{
private String name;
public void setname(String name)
{
this.name=name;
}
}
二:当一个类中定义了多个构造方法时,This关键字可以调用其他构造方法
class person
{
private String name;
private int age;
public person()
{
}
public person(String name)
{
this.name=name;
}
public person(String name,int age)
{
this(name); //调用上面一个构造方法,避免了写重复代码的麻烦
this.age=age;
}
}
- this的用法
- return this的用法
- this的用法
- this指针的用法
- this的深入用法
- this,super的用法
- Javascript的this用法
- this 的常用用法
- Javascript的this用法
- This的用法
- Javascript的this用法
- Javascript的this用法
- Javascript的This用法
- Javascript的this用法
- this的详细用法!!
- JAVA的this用法
- Javascript的This用法
- Javascript的This用法
- VB备份与还原SQL数据库代码
- 各种平台下Perl模块的安装方法
- CWnd::MessageBoxw:cannot convert parameter 1 from 'const char[19] to ' 'LPCTSTR'
- win2003 64位英文 IIS安装.net 2.0时的问题 IsDomainController failed with HRESULT 80070842
- Android编程获取手机型号,本机电话号码,sdk版本及firmware版本号(即系统版本号)
- This的用法
- Razor引擎学习:RenderBody,RenderPage和RenderSection
- 影像阅读
- 20条编程经验(转载)
- 内核管理之CPU基本组件
- Myeclipse6.5优化技巧
- linux驱动开发环境的搭建 转一下别的大虾的经验
- 【转】C++函数指针,C++ 虚函数表解析
- htonl() htons()及inet_ntoa() inet_addr()的用法