JiafanZhou
版主
发贴: 736
积分: 61
|
于 2010-07-05 16:39
abstract class SuperClass { .... }
public class SubClass extends SuperClass { public void function1() { .... }
public static void staticFunction(SuperClass ref) { // casting to SubClass SubClass sub = (SubClass)ref;
//.... }
public static void main(String[] args) { SuperClass ref = new SubClass();
SubClass.staticFunction(ref); } }
When I was a kid I used to pray every night for a new bike. Then I realized that The Lord doesn't work that way, so I stole one and asked him to forgive me.
|