Explain pass by reference and pass by value?

Answer Posted / aravind

Pass By Reference:
Passing the reference of the variable or object. In java
objects are passed by reference.

Pass By Value:
Passing the copy of the value. In java primitives are
passed by value.

Is This Answer Correct ?    2 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is re-factoring in software?

556


What is a final class ?

569


can java object be locked down for exclusive use by a given thread? Or what happens when a thread cannot acquire a lock on an object? : Java thread

512


How we can declare a static variable?

619


How do you avoid global variables?

525






Which is bigger double or float?

504


How hashmap increases its size in java?

465


What is public static void main?

546


What is a constructor, constructor overloading in java?

507


Give few difference between constructor and method?

497


What are access specifiers in java ?

566


What are operators and its types?

535


Why heap memory is called heap?

564


What is the difference between a synchronized method and a synchronized block?

580


Explain the difference between collection api and stream api in java8?

484