Computer Science, asked by greatthink, 1 year ago

mention the following in terms of java...

1 : values passed in method.
2 : array is passed in method.

PLEASE HELP...URGENT...

BEST ANSWER.WILL MARK BRAINLIEST...

BRAINLY MEMBER HELP..☆​

Answers

Answered by sanchari46
1

Holla Mate ur answer is....

1) Pass by value

2)Pass by reference

Hope it helps u ❤❤❤❤


greatthink: thank you
sanchari46: Mention not
Answered by Salome4
1

Passing and Returning Objects in Java

Although Java is strictly pass by value, the precise effect differs between whether a primitive type or a reference type is passed.

When we pass a primitive type to a method, it is passed by value. But when we pass an object to a method, the situation changes dramatically, because objects are passed by what is effectively call-by-reference. Java does this interesting thing that’s sort of a hybrid between pass-by-value and pass-by-reference. Basically, a parameter cannot be changed by the function, but the function can ask the parameter to change itself via calling some method within it.

While creating a variable of a class type, we only create a reference to an object. Thus, when we pass this reference to a method, the parameter that receives it will refer to the same object as that referred to by the argument.

This effectively means that objects act as if they are passed to methods by use of call-by-reference.

Changes to the object inside the method do reflect in the object used as an argument..


greatthink: thank you
Salome4: do want example
greatthink: yes please , if u can
sanchari46: Great in copying buddy
Salome4: what
Salome4: thank you
Salome4: just search GeeksforGeeks this is the site where you will get example
greatthink: okay thank you
Salome4: Arre arre brainlist mark karke to site pe jao
Salome4: itni madad ki
Similar questions