196k views
5 votes
When a primitive type variable is passed as an argument to a method, what is passed into the receiving method's parameter variable

User Paracycle
by
4.7k points

1 Answer

1 vote

Answer:

The value of the primitive type variable is passed into the receiving method

Step-by-step explanation:

Examples of primitive data types are integers, floats, real, double, character, byte, etc.

When any of these data types variables are passed to a method, the method which receives the variables receives the value of the variable being passed.

Take, for instance; the following code segment:

int doubleNum(int num){ ..... }

int main(){ ... num = 2; doubleNum(num);}

The above function doubleNum will receive the value of num (which is 2).

User Andycam
by
4.6k points