Check out example codes for "pass by value in java". It will help you in understanding the concepts better.

Code Example 1

public class Main 
{ 
    public static void main(String[] args) 
    { 
        int x = 5; 
        x = change(x); 
        System.out.println(x); 
    } 
    public static int change(int x) 
    { 
        x = 10; 
      return x;
    } 
}

Learn ReactJs, React Native from akashmittal.com