使用this调用本类中的属性
来源:互联网 发布:windows中的文件属性 编辑:程序博客网 时间:2024/05/29 14:50
package lkp;class Person{private String name;private int age;public Person(String name,int age){this.name = name; //this调用本类中的属性this.age = age; //this调用本类中的属性}public String getInfo(){return name + age;}}public class Test{public static void main(String args[]){Person person = new Person("张三",20);System.out.println(person.getInfo());}}
0 0
- 使用this调用本类中的属性
- 使用this调用本类中的其他构造函数
- C#中this关键字-调用本类成员
- 子类调用父类方法中的this
- 【JAVA】调用类中的属性
- JavaScript中的this关键字使用的四种调用模式
- JavaScript函数调用中的this
- static方法 内不能用this调用本类方法原因
- JAVA_SE基础——32.this关键字调用本类的构造方法
- 方法中怎样调用本类中的方法
- 调用类中的属性和方法
- Java中的 this使用
- 使用this调用构造方法
- 使用$this关键字调用汽车类自身的方法
- 2、Reactjs中的属性(this.props)
- Reactjs中的属性(this.props)
- Reactjs中的属性(this.props)
- php调用类中属性和函数的常用方法->_=>_::_$this->
- 数据结构复习(在新位置上插入元素)
- poj 1180 Batch Scheduling 斜率优化dp
- 学习是为了找工作?
- BZOJ 1622: [Usaco2008 Open]Word Power 名字的能量
- undefined reference to libiconv_open ext/iconv/.libs/iconv.o by install phpsource
- 使用this调用本类中的属性
- Hibernate多对多@ManyToMany及多对一@ManyToOne学习
- Linux下memcached安装和启动方法
- 客户端Cookie的设置——可完成记住密码的操作
- 使用this调用构造方法
- 韩语学习之第一课
- 模板类与类模板、函数模板与模板函数等的区别
- 使用static声明方法
- URAL 1203 Scientific Conference(贪心 || DP)