title: Trouble with swap method-java
body: <p>Hello everyone I am currently creating a program where I want to swap index 2 and 4. I have the code completed however I do not receive an output and when I run the program I do not receive an error </p>
  
  <p>Here is what I have so fa:</p>
  
  <pre><code>public class test {
      public static void main(String[] args) {
          int[] intArray = {2,4,6,8,10};
      }
  
      char[] intArray;
      void swap(int i, int j, int[] arr) {
          int t = arr[2];
          arr[2] = arr[4];
          arr[4] = t;
          System.out.println(intArray);
      }
  }
  </code></pre>