public class ParameterExample { // Array is passed by reference: 4 or 8 byte address public void method1(byte [] array) { System.out.println("\tmethod1()"); } // Simulates what if we passed arrays and objects by value // This cannot actually be done in Java but since passing // by value creates a local copy we simulate the resources // used by creating a local array that is created each time // method is called. public void method2() { System.out.println("\tmethod2()"); byte [] array = new byte[999999999]; } }