Article View: borland.public.jbuilder.java.language
Article #19991Re: const in Java
From: Steve Demuth
Date: Tue, 11 Nov 1997 00:00
Date: Tue, 11 Nov 1997 00:00
38 lines
1410 bytes
1410 bytes
Brian is correct that java has not const keyword, but incorrect that you can't accomplish void a(const char* a); in java. In fact, allowing for the difference between a char* and a String object, void a(String a) does exactly that. In java all arguments are passed by value (that is, as constant references, or "const p*". Steve Demuth Artemis Alliance Brian Burton <brian.burton@burton-computer.com> wrote in article <346207B2.3651FB01@burton-computer.com>... > No. Java does not have const. > ++Brian > > Ferran Busquets ForοΏ½s wrote: > > > > How can i call a method with a const parameter? > > > > In c++ i can do this: void a(const char* a); > > > > Can i do the same thing in java? > > > > Thanks! > > -- > Brian Burton Custom Software Development > Burton Computer Corporation Java, C++, Orbix, Tuxedo > http://www.burton-computer.com OO Consulting and Mentoring >
Technical Details
Message-ID:
<01bceecf$1dbb8200$cb00a8c0@pentpro5>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailReferences:
<3460FE29.6E0B0E7D@partal.com> <346207B2.3651FB01@burton-computer.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII X-Google-Thread: f74b3,281638c33db843f0 X-Google-Attributes: gidf74b3,public From: "Steve Demuth" <steved@artemisalliance.com> Subject: Re: const in Java Date: 1997/11/11 Message-ID: <01bceecf$1dbb8200$cb00a8c0@pentpro5> X-Deja-AN: 288667918 References: <3460FE29.6E0B0E7D@partal.com> <346207B2.3651FB01@burton-computer.com> Organization: None Newsgroups: borland.public.jbuilder.java.language