Can I do in Java the same thing I do in Pascal ?

In Pascal, I may write a procedure :
procedure poser_question (VAR question: t_question);
The parameter question is passed by reference, so it works as a resultat parameter.
According to my Java book, parameters are only passed by value, so I cannot have the construction :
Combi question = new Combi ();
poser_question (question);
Is it exact ? Or may 'question' in calling poser_question (question) be a resultat parameter ?

Jean-Jacques wrote:
In Pascal, I may write a procedure :
procedure poser_question (VAR question: t_question);
The parameter question is passed by reference, so it works as a resultat parameter.
According to my Java book, parameters are only passed by value, so I cannot have the construction :
Combi question = new Combi ();
poser_question (question);Java passes variables by value, but there are two separate kinds; primitive and reference variables. In your example you're passing a Combi object reference (by value). This means that a reference (pointer) to the Combi object becomes available within the poser_question method. You can use this reference to change fields in the Combi object (which exists outside poser_question).
The above is equivalent to what would happen in Pascal if you were to pass a Combi record by VAR.

Similar Messages

Maybe you are looking for

  • Issues after Upgrading to SP18 (WAS)

    Hi all we recently upgraded our MI Server from SP 14 to SP 18 but after doing this we are not able to get any data to the device. When i check the SE37 transaction in the R/3 data is available for the User and also the same data is available in the M

  • How to Confirm the SDAs deploy order of SCA in RemoteGUI of SDM

    Hello everybody,        We assemblied a sca file in NWDI when we finished development.        But when we used RemoteGUI to deploy the SCA file in another NetWeaver2004s engine.The Deploy order is wrong.The SDM doesn't first deploy the Library,EAR.It

  • App Error 104 troubleshooting

    I've got a Blackberry Bold 9900 running Software Version 7.1 Bundle 1997, my carrier is AT&T. The phone is a couple of months old after the screen died on my previous Bold 9700. I use it primarily as a phone, calendar, and address book, lots of email

  • Can't relink missing jpegs

    I opened my project this morning and see this: and then this: After opening the project I see the color bars and double-click one of the missing images in the project window to relink it. After going to the location and see that all of my files are g

  • Where is the 'History Recently Closed Tabs' menu in Firefox 29

    There used to be a 'Recently Closed Tabs' in the old orange Firefox 28 menu. Now it seems version 29 only has a 'Restore Closed Tabs' menu item in its 'History menu'. There seems to be no option to restore individually closed tabs. I'm always closing