Search an array and return index if a specific value is found
<p>This is more of just a syntax error, as most of my code as it is runs perfectly fine. The issue is that if a value is not found within the array, I'd like the program to print it out. Can't seem to find a place to write that part of code without the program writing out "Not found" on every line. Below is my code and console output. Thanks all.</p>

<p>Code:</p>

<pre><code> public static void main(String[ ] args)
 {
  final int[ ] DATA = { 2, 4, 6, 8, 10, 12, 14 };
  final int[ ] EMPTY = new int[0];
  final int MINIMUM = 0;
  final int MAXIMUM = 16;

  int target;

  System.out.println("Searching for numbers in an array.");
  for (target = MINIMUM; target &lt;= MAXIMUM; target++)
  {
      System.out.print("\nIs " + target + " in the array? ");
      {
          for (int index = 0; index &lt; DATA.length; index++)
          {
               if ( DATA[index] == target )
                   System.out.printf("Yes! %d was found at index [%d]", target, index);
          }
      }
  }
</code></pre>

<p>Console Output:</p>

<pre><code>Searching for numbers in an array...

Is 0 in the array? 
Is 1 in the array? 
Is 2 in the array? Yes! 2 was found at index [0]
Is 3 in the array? 
Is 4 in the array? Yes! 4 was found at index [1]
Is 5 in the array? 
Is 6 in the array? Yes! 6 was found at index [2]
Is 7 in the array? 
Is 8 in the array? Yes! 8 was found at index [3]
Is 9 in the array? 
Is 10 in the array? Yes! 10 was found at index [4]
Is 11 in the array? 
Is 12 in the array? Yes! 12 was found at index [5]
Is 13 in the array? 
Is 14 in the array? Yes! 14 was found at index [6]
Is 15 in the array? 
Is 16 in the array? 
</code></pre>