java最基础

来源:互联网 发布:owncloud php组件 编辑:程序博客网 时间:2024/05/01 19:57

1、this的用法:
this.表示当前对象

public class Test{
private String s ;
public Test(String s){
this.s = s;
}

this()的用法:调用当前的无参构造方法,类似于super()

2、super:之父类对象
super():调用父类的无参构造方法

原创粉丝点击