静态网站建设摘要,简单html网页代码完整示范,通辽企业网站建设,海南省做购房合同网站马克-to-win#xff0c;Super是一个参考(或说指针)指向他紧邻的父类(见下面的例子)。Super is a reference of its neighbour superclassSo Use super to call superclass’s constructor用super可以指向被隐藏的父类的同名成员。Use super to call superclass’s members tha…马克-to-winSuper是一个参考(或说指针)指向他紧邻的父类(见下面的例子)。Super is a reference of its neighbour superclassSo Use super to call superclass’s constructor用super可以指向被隐藏的父类的同名成员。Use super to call superclass’s members that has been hidden by a member of a subclass.3.1 super指向父类的成员注 意 下例中子类和父类都有i我们一共有两个i用super可以指向前一个父类的i。 note that: in the following case, subclass and super class both have a i, so altogether they have two i.例1.3.1class AMark_to_win {int i;}class B extends AMark_to_win {int i;public B(int x, int y) {super.i x;//AMark_to_win 的 i被赋值i y;//B的i被赋值}public void show() {System.out.println(i in superclass: super.i);System.out.println(i in subclass: i);}}public class Test {public static void main(String[] args) {B b new B(2, 3);b.show();}}result is:i in superclass: 2i in subclass: 3