Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8996699
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T23:47:23+00:00 2026-06-15T23:47:23+00:00

If a function is called using Call-by-Reference , then any changes made to the

  • 0

If a function is called using Call-by-Reference, then any changes made to the variable inside the function are affected immediately to the caller. And for Call-by-Sharing, it is affected at the end of the function.

Question 1: Does Java uses Call-by-Sharing instead of Call-by-Reference?

Question 2: I think that Call-by-Sharing differs from Call-by-Reference only while multithreading. It is created only to decrease concurrent over-writing of values while it is being used in some other thread; to provide consistency. Am I right?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T23:47:23+00:00Added an answer on June 15, 2026 at 11:47 pm

    I would recommend that you don’t use “call by sharing” terminology. As this Wikipedia article states:

    “However, the term “call by sharing” is not in common use; the terminology is inconsistent across different sources. For example, in the Java community, they say that Java is pass-by-value, whereas in the Ruby community, they say that Ruby is pass-by-reference[citation needed], even though the two languages exhibit the same semantics. Call-by-sharing implies that values in the language are based on objects rather than primitive types.”

    and

    “Although this term has widespread usage in the Python community, identical semantics in other languages such as Java and Visual Basic are often described as call-by-value, where the value is implied to be a reference to the object.”

    The bottom line is that Java uses “call by sharing” … but they don’t call it that, and you probably shouldn’t either if you want Java people to understand you.


    I think that Call-by-Sharing differs from Call-by-Reference only while multithreading. It is created only to decrease concurrent over-writing of values while it is being used in some other thread; to provide consistency. Am I right?

    No, you are not right.

    “Call by sharing” really means “call by value” in the case where the value is an object reference. True “call by references” means you are (in effect) passing the address of a variable, and the called method can update the variable.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using a library function called get_count_and_price which returns a 2-tuple (count,price). In
I am using jQuery(Latest release) and have a function called calculate() which gets called
I'm using linux. I have a function called like: PlayBackgroundIntroMusic((char *)IntroMusic); The functions is:
Using C#, I need to do some extra work if function A() was called
I'm using Python's max function to find the largest integer in a dictionary called
in my application i am using xmlhttp, which is called by a function after
I have a function called call facebook. call_facebook(284328420994); call_facebook(197214710347172); It runs severaltimes It makes
I want to call a webservice using jQuery.ajax() but the webervice doesn't get called.
I have a Python function called func that I am trying to time using
I am trying to figure out how to call a javascript function using text

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.