Briefly explain how parameter passing by value and by


Question: Briefly explain how parameter passing by value and by reference is accomplished in memory. Write statement 1 to call Method A below.

Write statement 2 to call Method B. Which method uses pass by value? Which method uses pass by reference?

static void

Main()

    {

      int bal = 12000;

      //statement 1

      //statement 2

 

    }

 

//method A

    public static void addFunds(ref int bal)

    {

      bal = bal + 600;

    }

 

//method B

    public static int addFunds(int bal)

    {

      return (bal + 600);

    }

Make this program using java programming. Make this application in simple way.

Request for Solution File

Ask an Expert for Answer!!
JAVA Programming: Briefly explain how parameter passing by value and by
Reference No:- TGS0959832

Expected delivery within 24 Hours