Results 1 to 3 of 3
Like Tree1Likes
  • 1 Post By KevinWorkman

Thread: Does Java have a pass by reference?

  1. #1
    357mag is offline Member
    Join Date
    May 2010
    Rep Power

    Default Does Java have a pass by reference?

    Seems to me when I studied C++ there was a pass-by-value and a pass-by-ref. If I remember correctly, an example program that showed this stuff had the variables original value unchanged after a method call that used it, and the other one changed the value of the variable. I see a pass-by-value example program in my book but I don't see a pass-by-ref example.

    Just wondering if Java has pass-by-ref at all.

  2. #2
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Voorschoten, the Netherlands
    Blog Entries
    Rep Power

    Default Re: Does Java have a pass by reference?

    Java uses the pass by value mechanism only (just as C does).

    kind regards,

    Build a wall around Donald Trump; I'll pay for it.

  3. #3
    KevinWorkman's Avatar
    KevinWorkman is offline Crazy Cat Lady
    Join Date
    Oct 2010
    Washington, DC
    Rep Power

Similar Threads

  1. Concept of Pass by Reference in Java
    By allaudin in forum New To Java
    Replies: 3
    Last Post: 05-15-2013, 05:24 PM
  2. pass by reference?
    By wayenng in forum New To Java
    Replies: 7
    Last Post: 12-24-2012, 06:36 PM
  3. How to create pass by reference??
    By --> xeiyne! in forum CLDC and MIDP
    Replies: 4
    Last Post: 04-08-2010, 06:43 PM
  4. Don't pass by reference
    By Lyven in forum Advanced Java
    Replies: 6
    Last Post: 11-16-2009, 06:06 PM
  5. Pass-by-reference
    By popjava in forum New To Java
    Replies: 1
    Last Post: 10-19-2009, 03:45 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts