this关键字
来源:互联网 发布:我的淘宝流量入口 编辑:程序博客网 时间:2024/06/14 14:34
this关键字:
代指将来本类的对象(类中声明的变量/全局的)
public class ChPerson {public String name;public char sex;/** * 无参函数 * 系统会默认给每个类创建的函数 */public ChPerson(){}/** * 有参构造 * @param name * @param sex */public ChPerson(String name,char sex){//this关键词this.name = name;this.sex = sex;}public void show(){System.out.println("我的姓名是:"+name);System.out.println("我的性别是:"+sex);}}
阅读全文
0 0
- 关键字this
- this关键字
- this关键字
- this 关键字
- this 关键字
- this关键字
- this关键字
- this 关键字
- this 关键字
- this 关键字
- this关键字
- 关键字this
- 关键字this
- this 关键字
- this 关键字
- this关键字
- this关键字
- This关键字
- 初学者使用循环的小套路
- 三商人三仆人过河问题
- springdate单元测试
- 欧拉函数
- MySQL----int(M)讲解 (int(3)与int(11)的区别)
- this关键字
- 图像分类与KNN
- 1004. Counting Leaves (30)(*****dfs/bfs)
- WWW服务器【Linux-shell】
- 50. Pow(x, n)
- 数据库封锁协议
- Android——View的触摸传递机制
- log4j+flume+HDFS实现日志存储
- This kernel requires an X86-64 CPU,but only detected an i686 CPU解决方案