Article View: be.comp.programming
Article #5008Re: Namespaces in Java?
From: Ingo Wassink
Date: Mon, 09 Jun 2003 18:23
Date: Mon, 09 Jun 2003 18:23
24 lines
1700 bytes
1700 bytes
> Het wordt pas spannend als je geen int wilt, maar een type safe
> enum.
>
Is volgens mij ook nog niet zo moeilijk:
public final class Boolean{
public static Boolean TRUE = new Boolean();
public static Boolean FALSE = new Boolean();
private final Boolean(){
}
public void not(Boolean B){
if(B == TRUE) return FALSE;
return TRUE;
}
etc..
}
Nu heeft Boolean maar twee mogelijke instanties namelijk TRUE en FALSE.
Hetzelfde kun je doen voor andere dingen.
Groetjes Ingo
Technical Details
Message-ID:
<bc2jbj$kqr$1@netlx020.civ.utwente.nl>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-09!supernews.com!news.maxwell.syr.edu!surfnet.nl!news.utwente.nl!not-for-mailReferences:
<bc2fqd$1iba$1@nl-news.euro.net> <1hi9evkahh5ra31jcaj86be03k3jlhv3oj@4ax.com>Show Full Headers
Complete Article Headers
X-Google-Language: DUTCH,ASCII-7-bit X-Google-Thread: 107324,49bd6e9024ebf456 X-Google-Attributes: gid107324,public X-Google-Thread: fcea4,49bd6e9024ebf456 X-Google-Attributes: gidfcea4,public X-Google-ArrivalTime: 2003-06-09 11:23:48 PST Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-09!supernews.com!news.maxwell.syr.edu!surfnet.nl!news.utwente.nl!not-for-mail From: "Ingo Wassink" <i.wassink@student.utwente.nl> Newsgroups: be.comp.programming,nl.comp.programmeren Subject: Re: Namespaces in Java? Date: Mon, 9 Jun 2003 20:23:56 +0200 Organization: University of Twente, Enschede, The Netherlands Lines: 26 Message-ID: <bc2jbj$kqr$1@netlx020.civ.utwente.nl> References: <bc2fqd$1iba$1@nl-news.euro.net> <1hi9evkahh5ra31jcaj86be03k3jlhv3oj@4ax.com> NNTP-Posting-Host: inbel243193.inbel.utwente.nl X-Trace: netlx020.civ.utwente.nl 1055183028 21339 130.89.243.193 (9 Jun 2003 18:23:48 GMT) X-Complaints-To: abuse@utwente.nl NNTP-Posting-Date: Mon, 9 Jun 2003 18:23:48 +0000 (UTC) X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1106 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106