Article View: cn.bbs.comp.lang.java
Article #18491Re: [��]���ʿ���һ�ʡ�
From: ������
Date: Tue, 10 Feb 2004 09:13
Date: Tue, 10 Feb 2004 09:13
38 lines
2127 bytes
2127 bytes
package A;
public interface A {
void doStuff();
}
class MyA implements A {
public void doStuff() {
System.out.println("hello");
}
}
public abstract class AFactory {
public static A createA() {
return new MyA();
}
}
package B;
public class B {
public static void main(String[] args) {
A a = A.AFactory.createA();
a.doStuff();
}
}
�� �� romie (Raymond) �Ĵ������ᵽ: ��
: Ŷ����û����inner class�������Ժ������һ�¡�
: ���о�����̴����ˡ���û�м�̵����Ӵ��룿��һ����
: ��������⡣^^
: �� �� windprayer (������) �Ĵ������ᵽ: ��
: : ����
: : ����override���super class/interface��public method
: : �������Ϊһ��super class/interface��ʵ����package�ⱻʹ��
: : �����anonymous inner class
--
���� ��Ĭ ���� ��� �ڼ� ���� �Ͽ� ���� ���� ��� �侲 ���
[1;36m�� ������:��windprayer � Feb 10 17:13:13 �ı������ݡ�[FROM: 10.11.71.253][m
[m[1;37m�� ��Դ:��Ʈ��ˮ�Ƽ� freecity.cnzju.net��[FROM: 10.11.71.253][m
Technical Details
Message-ID:
<4Ab5Dg$9KV@freecity.cnzju.net>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!c03.atl99!sjc70.webusenet.com!news.usenetserver.com!news.bylinux.net!news.ccie.net.cn!FreecityShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,GB X-Google-Thread: f6cb0,b80e1f7e61bef9f4 X-Google-Attributes: gidf6cb0,public X-Google-ArrivalTime: 2004-02-10 01:15:59 PST Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!c03.atl99!sjc70.webusenet.com!news.usenetserver.com!news.bylinux.net!news.ccie.net.cn!Freecity From: windprayer.bbs@freecity.cnzju.net (������) Newsgroups: cn.bbs.comp.lang.java Subject: Re: [��]���ʿ���һ�ʡ� Date: 10 Feb 2004 09:13:13 GMT Organization: Ʈ��ˮ�Ƽ� Message-ID: <4Ab5Dg$9KV@freecity.cnzju.net> Mime-Version: 1.0 Content-Type: text/plain; charset="gb2312" Content-Transfer-Encoding: 8bit X-Filename: Java/M.1076404122.A Lines: 38