main程序输出:
class Alpha { Alpha get() { return this; } void message() { System.out.println("This is Alpha"); } } class Beta1 extends Alpha { void message() { System.out.println("This is Beta1"); } } class Beta2 extends Alpha { Beta2 get() { return this; } void message() { System.out.println("This is Beta2"); } } public class Main { public static void main(String[] args) { new Beta1().get().message(); new Beta2().get().message(); } }