super and this
1、super(参数):调用基类中的某一个构造函数(应该为构造函数中的第一条语句)
2、this(参数):调用本类中另一种形成的构造函数(应该为构造函数中的第一条语句)
3、super: 它引用当前对象的直接父类中的成员(用来访问直接父类中被隐藏的父类中成员数据或函数,基类与派生类中有相同成员定义时)
如:super.变量名
super.成员函数据名(实参)
4、this:它代表当前对象名(在程序中易产生二义性之处,应使用this来指明当前对象;如果函数的形参与类中的成员数据同名,这时需用this来指明成员变量名)
class Point
{ private int x,y;
public Point(int x,int y)
{
this.x=x; //this它代表当前对象名
this.y=y;
}
public void Draw()
{
}
public Point()
{
this(0,0); //this(参数)调用本类中另一种形成的构造函数
}
}
class Circle extends Point
{
private int radius;
public circle(int x0,int y0, int r )
{
super(x0,y0); //super(参数)调用基类中的某一个构造函数
radius=r;
}
public void Draw()
{
super.Draw(); //super它引用当前对象的直接父类中的成员
drawCircle();
}}
分享到:
相关推荐
Title : Super PI Ver1.1e (calculation of pi up to 33.55 million digits) Keywords: PI MATH WINDOWS In August 1995, the calculation of pi up to 4,294,960,000 decimal digits was succeeded by using a...
Cross-lingual Entity Linking (XEL) aims to ground entity mentions written in any language to an English Knowledge Base (KB)...scenarios, and shows the value of joint supervision in low-resource settings
This perfect publication about MUSIC for multidimensional spectral estimation: stability and super-resolution.
task and a lower level super-resolution process, in which we incorporate reconstruction-based super-resolution algorithms, single-image enhancement, and image/video classification into a single ...
Benefit from your personally configured super computer which is a power efficient, low-cost, and highly scalable super computer Write your own cluster software with the help of practical examples ...
Super resolution (SR) methods typically assume that the low-resolution (LR) image was downscaled from the unknown high-resolution (HR) image by a fixed ‘ideal’ downscaling kernel (e.g. Bicubic ...
Expiry Time and Garbage Collection 过期时间和垃圾收集,这里主要设置缓存文件过期时间,和多久删除一次过期的缓存文件。个人建议:一般缓存时间设置为1天(86400)左右,缓存删除时间为1个小时一次。 Accepted ...
In this study, we overcome this limitation by incorporating a "mix-and-match" (M&M) tuning stage in the self-supervision pipeline. The proposed approach is readily pluggable to many self-supervision ...
Since then he has supported his brother David in refining and expanding the scope of this popular linear algebra text, including writing most of Chapters 8 and 9. Steven is also the author of three ...
This handy, one–stop guide catches you up on XHTML basics and CSS fundamentals. You′ll learn how to work with Positionable CSS to create floating elements, margins, and multi–column layouts, and ...
4. **其他设置**:在Profile Overview的Tools And Settings中,可以设置备份日志,例如Program Settings的Logs选项卡,可选择为每个备份项目创建单独的日志文件。 通过这些详细配置,用户可以根据自己的需求定制...
This manual has been produced as a text book to introduce radar interferometry to ... There, the manual also includes an appreciation of themes such as super resolution and ERS/Envisat interferometry.
Since Walter’s Turtles, technology has come a long way ... The last chapter is on the future of AI and robotics in the foreshadow of the prophecies of super intelligent AI and technological singularity.
The topic of this book is related to the prospects of both the super-intelligent machines and the super-intelligent humans, which can far surpass the current human intelligence, significantly lifting ...
4. **其他设置**:在Profile Overview界面的Tools And Settings中,可以设置日志记录,如Program Settings的Logs选项卡,可以选择每次备份创建单独的日志文件。 通过以上详细步骤和高级配置,用户可以根据自身需求...
wrangling millions of customer ratings and customer transactions to produce things such as personalized recommendations for movies and products and "people who bought this also bought." I tell you, I...