--%>

Explain Call-by-value

Call-by-value: The semantics of passing an argument to a method in which a copy of actual argument value is taken and positioned in a separate memory location, symbolized by the corresponding formal argument. As an outcome, assignment to the formal argument in a method can encompass no effect on the value stored in actual argument. This principle is frequently misunderstood in Java. This does not mean that an object referred to by an actual argument can’t be modified through the formal argument. Consider the illustration of sorting the array termed to by the variable numbers:

Arrays.sort(numbers);

The sort method will modify the order of the values stored in the object referred to by numbers. Though, it is not possible for the sort method to modify that array numbers refers to - a sorted copy, for example. Some languages give an argument passing semantics termed as call-by-reference, in which an actual argument's value might be modified. Java does not offer this, however.

   Related Questions in Programming Languages

  • Q : Define owns to the Kernel Object Define

    Define owns to the Kernel Object? Answer: Kernel objects are owned through the kernel, not through a process.

  • Q : Define Java 2 SDK Java 2 SDK : It is a

    Java 2 SDK: It is a particular implementation of the abstract functionality explained in Sun's specification of Java 2 Platform.

  • Q : Monte Carol method to estimate pi An

    An interesting way to estimate pi can can done using Monte Carol method with minimal mathematics. Monte Carlo is known for its casinos. A Monte Carlo method uses change, or in our case, random numbers to simulate the real situation. The situation we simulate here is t

  • Q : What is an Immutable object Immutable

    Immutable object: It is an object whose state might not be modified. The objects of String class are immutable, for example - their length and contents are fixed once formed.

  • Q : Homework Assignment How much would it

    How much would it cost to do a basic program within the given requirements?

  • Q : Define Applet Applet : The Applets are

    Applet: The Applets are Java programs based on the Applet or JApplet classes. They are closely related with the capability to give active content within the Web pages. They have numerous features that differentiate them from ordinary Java graphical ap

  • Q : Explain One Dimensional array One

    One Dimensional array:1) An array is a continuous memory location having similar kind of data in a single row or single column. Declaration in c++ is as under: const int size = 20;int a[size] or int a[2

  • Q : How you explain binding in WSDL How you

    How you explain binding in WSDL?

  • Q : State the term dispatcher State the

    State the term dispatcher.

  • Q : Explain Abstraction Abstraction : It is

    Abstraction: It is a simplified symbolization of something which is potentially quite complex. It is frequently not essential to know the precise details of how something works, is symbolized or is implemented, since we can still make use of it in its