Call by reference in Java?

From: Ekim (the.newsletter_at_gmx.net)
Date: 02/25/04


Date: Wed, 25 Feb 2004 19:24:29 +0100

hy,

I've a simple, maybe stupid question.
How does a "pointer" look like in Java? I've just tried a "*" like in C, but
it didn't work.
Now I'm not sure in which way I can solve my problem.

The task is, that I want to call a procedure, and the parameters shall be
call by reference.
For example, this is my procedure call:
    checkParameter(kosten_pro_liter, liter, kosten, gesamt_km);

The definition of my procedure looks like this:
  public void checkParameter(String strPreisProLiter, String strAnzahlLiter,
    String strPreis, String strGesamtkilometer) {.....}

What can I do so that after the procedure was executed, the parameters have
the value they have been given within the procedure?

thx,
ekim



Relevant Pages

  • RE: Use of Mid Statement in VB.Net
    ... (It can also be used from other .NET languages, is well-tested, and is ... Convert VB to C#, C++, or Java ... Mid(buffer, pointer, MyFields.mfRecordType) = "A" ... method for either String or StringBuilder would not be appropriate for the ...
    (microsoft.public.dotnet.languages.vb)
  • Re: Java String comparison
    ... but kinda new to Java... ... pointer type, such as pointer to string (although it is ... an empty string to indicate it is set but is empty. ...
    (comp.lang.java.programmer)
  • Re: Java String comparison
    ... but kinda new to Java... ... pointer type, such as pointer to string (although it is ... an empty string to indicate it is set but is empty. ...
    (comp.lang.java.help)
  • Re: pass by reference in java?
    ... the same in Java? ... the value (either pointer or primitive) is passed. ... not have pointers to primitives, ... For example if you pass a string into a function and then change the string ...
    (comp.lang.java.programmer)
  • Re: Cloning and Distinct Copies of Objects
    ... 11/780 Assembler class in the 1980s), so I find there's a lot of times that ... lot of dangerous baggage that C added to the concept of "pointer", ... Java forces its references to either be ... Why do you want to avoid sharing String objects? ...
    (comp.lang.java.help)