this关键字
来源:互联网 发布:银科环企软件 编辑:程序博客网 时间:2024/06/05 00:26
/*
*/
class person
{
private String name;
private int age;
person(String name)
{
this.name =name;
}
person(String name,int age)
{
//this.name =name;
this(name);//p(name);
this.age =age;
}
}
this语句用于构造函数之间进行相互调用
this代表本类中的对象,代表所在函数所属对象的引用
只能定义在构造函数第一行,因为初始化要先执行*/
class person
{
private String name;
private int age;
person(String name)
{
this.name =name;
}
person(String name,int age)
{
//this.name =name;
this(name);//p(name);
this.age =age;
}
}
1 0
- 关键字this
- this关键字
- this关键字
- this 关键字
- this 关键字
- this关键字
- this关键字
- this 关键字
- this 关键字
- this 关键字
- this关键字
- 关键字this
- 关键字this
- this 关键字
- this 关键字
- this关键字
- this关键字
- This关键字
- Spark-Streaming 程序监控
- Win32 SDK基础(2)—— 自己动手用cl.exe和link.exe编译和连接程序
- 阿里Druid连接池配置使用
- 软工总结---分析阶段(计划阶段)
- HDU.2096
- this关键字
- ImageIcon的相对路径设置
- strust2 文件上传
- StringUtils中isEmpty 和isBlank的区别
- LinkedHashMap剖析
- binder学习
- Android G711(PCMA/PCMU)、G726、PCM音频转码到AAC
- 1034: [ZJOI2008]泡泡堂BNB
- Leetcode||18. 4Sum