有的,將它們全部寫在同一行裡,哈哈。
public class Parent {
protected int i;
public Parent(int i) {
this.i = i;
}
}
public class Child extends Parent {
public Child(String s) {
super(convertor(s));
}
private static int convertor(String s) {
return Integer.parseInt(s);
}
}
沒有留言:
張貼留言