/** * Class: BMIS 3301 Web Programming with Java * Instructor: Jingshan Xiao * Description: Reversing Numbers : Exercise 6_3 * Due: 10/14/2007 * @author Matthew Milam */ import javax.swing.JOptionPane; public class Exercise6_9f{ // Main method public static void main(String[] args) { int[] numbers = {1, 2, 4, 5, 10, 100, 2, -22}; } public static int smllElement(int[] numbers) { int max = numbers[0]; for (int i = 0; i < numbers.length; i++) { if ( max > numbers[i] ) max = numbers[i]; } //Prepare Result String output = "The array is "; for (int i = 0; i < numbers.length; i++) { output += numbers[i] +""; } output +="\nThe Smallest Element is " + max; //Display Result JOptionPane.showMessageDialog(null, output); return max; } }

Anyone? Thanks in advance.