什么东西。。。。
- class Bird {
- private int aTest;
- public int bTest;
-
- public Bird(int aTest, int bTest) {
- super();
- this.aTest = bTest;
- this.bTest = bTest;
- }
-
- @Override
- public String toString () {
- return "" + aTest + "-" + bTest;
- }
- }
- public class Swallow extends Bird{
- public Swallow(int aTest, int bTest) {
- super(aTest, bTest);
- }
-
- public static void main (String[] args) {
- Bird b1 = new Swallow(1, 1);
- System.out.println(b1);
-
- Swallow s = new Swallow(2, 2);
- System.out.println(s);
- }
- }
复制代码
|