---
title: "继承中的this和super的区别"
author: "zhou_wu"
date: "2010-11-17T09:22:29Z"
tags: []
categories: ["编程语言"]
slug: "this-super"
draft: false
lastmod: "2010-11-17T09:22:29Z"
id: 813512
url: "https://leesmart.iteye.com/blog/813512"
---

```java
class Person{
int age;
int height;
void eat(){}
void sleep(){}
Person(){} //父类构造方法
}
class Student extends Person{
int score;
void study(){}
Student(){}//子类构造方法
}
```


![](http://dl.iteye.com/upload/attachment/349733/54506a71-9068-3567-8d16-df97311981af.jpg)

<span style="color:red">注意</span>:this不能引用父类的构造函数