在给父母提供数据的情况下,创建孩子的最佳方法是哪种?是否可以在子类上使用包含所有父值的方法:
public class Child extends Person {
public Child(Parent p) {
this.setParentField1(p.getParentField1());
this.setParentField2(p.getParentField2());
this.setParentField3(p.getParentField3());
// other parent fields.
}
}
Run Code Online (Sandbox Code Playgroud)
复制父数据ti子对象?
Child child = new Child(p);
Run Code Online (Sandbox Code Playgroud) 我测试了navigator.online,直到我用PhoneGap构建了应用程序,之后,navigator.online总是返回true.有谁知道如何取消缓存或刷新此值?我需要"点击"活动.