--%>

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 : What is an Overriding for breadth

    Overriding for breadth: It is a form of method overriding in which the sub-class version of a technique implements its own behavior within the context of attributes and behavior of the sub-class and then calls the super-class version and hence it can

  • Q : Define the term New operator Define the

    Define the term New operator: The operator employed to generate instances {instance} of a class.

  • Q : Attatching CSS to HTML documents

    Explain the different ways in order to attach the CSS to HTML Documents?

  • Q : Are you sure that XHTML element name

    Are you sure that XHTML element name case sensitive? Answer: XHTML element names surely are case sensitive. Every element names should be written within lower case l

  • Q : Describe Overriding for restriction

    Overriding for restriction: It is a form of method overriding in which the sub-class version of a method calls the super-class version first of all and then employs or manipulates the outcome or consequences of that call in some manner.

  • Q : Define the term Arpanet Define the term

    Define the term Arpanet: It is a network which was a forerunner of the global Internet.

  • Q : Define Object-oriented language

    Object-oriented language: Programming languages like Java and C++ which permit the solution to a trouble to be stated in terms of objects that belong to the classes.

  • Q : State Non-modal Non-modal : In this a

    Non-modal: In this a dialog is non-modal when its parent application is not blocked from additional activity whereas the dialog is being revealed.

  • Q : What is Abstract method Abstract method

    Abstract method: This is a method with the abstract reserved word in its header. The abstract method has no method body. Methods stated in an interface are for all time abstract. The body of an abstract method should be stated in a su

  • Q : What is an Infinite recursion Infinite

    Infinite recursion: Recursion which does not finish. This can effect from any of direct recursion, indirect recursion or the mutual recursion. It is generally the outcome of a logical error, and can consequence in stack overflow.