- class Fu{
- int num = 5;
- Fu(){
- System.out.println(num);
- show(); //55
- System.out.println(num); //5
- }
- void show(){
- System.out.println("55");
- }
- }
- class Zi extends Fu{
- int num = 3;
- Zi(){
-
- }
- void show() {
- System.out.println(num);
- }
- }
- public class Demo {
- public static void main(String[] args) {
- Zi z = new Zi();
-
- }
- }
复制代码 |
|