πŸš€ go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.jbuilder.java.language
Article #19742

Re: const in Java

#19742
From: Paul Murray
Date: Wed, 24 Dec 1997 00:00
15 lines
924 bytes

Ferran Busquets ForοΏ½s wrote in message <3460FE29.6E0B0E7D@partal.com>...
>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!

Strings are immutable in java - so passing a String will do what you want
here (use StringBuffer for mutable strings). Anything else, you will have to
organise your class so that it will not allow itself to get written to in an
uncontrolled way.
Technical Details
Message-ID: <685g76$nqr2@forums.borland.com>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail
References: <3460FE29.6E0B0E7D@partal.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII
X-Google-Thread: f74b3,281638c33db843f0
X-Google-Attributes: gidf74b3,public
From: "Paul Murray" <pmurray@bigpond.com>
Subject: Re: const in Java
Date: 1997/12/24
Message-ID: <685g76$nqr2@forums.borland.com>
X-Deja-AN: 310744880
References: <3460FE29.6E0B0E7D@partal.com>
X-MimeOLE: Produced By Microsoft MimeOLE V4.71.1712.3
Organization: N/A
Newsgroups: borland.public.jbuilder.java.language