title: middle number in array with two methods java
body: <p>How do I get my code to find the middle number? Whenever I run my code, I can enter my desired numbers but it doesn’t tell me what the middle number is.</p>
  
  <pre><code> public static int middleArray(int values[])
   {
     //reading numbers into the array
    int [] ma = new int [0];
    int middleArray;
    if(values.length % 2 == 0)
    {
        int num1=(values.length-1)/2;
        int num2 = values.length/2;
  
        middleArray = ( values[num1] + values[num2])/ 2;
        return middleArray;
      }  
           else
       {
          int num = (values.length - 1) / 2;
          middleArray = values[num];
  
       }
         return middleArray;
       }
      public static void main() {
     Scanner s = new Scanner(System.in);
     System.out.println("Enter a series of numbers to determine middle 
     number");
     int middleArray = s.nextInt();
  
  
    }
   }
  </code></pre>