Provide a detailed example explaining the difference between passing an array to a method by value and passing an array to a method by reference.