我在下面写一个代码, 我需要从母类的静态方法中 获得一个儿童类的价值。
有人能帮我解决吗?
public abstract class DataObject<T>{
public static int GetAllTotal(){
// How can I obtain a T propery called "code" = "001".
int cont = SQL.getTotalFromQuery(
"SELECT * from tblProducts where code = 001 "
);
return ffff
}
...
}
public class Product extends DataObject<Product>{
private String code = "001";
public Product(){
}
}
...
Product.GetAllTotal();