I am trying to create a program that finds the largest number in array of integers than are inputted by the user using JOptionPane. Here is the code I have s far but I am getting errors when compiling.
import javaz.swing.JOptionPane;
public class Week9Largest {
public static void main(String[] args) {
int [] x = new int [7] ;
string myString;
int myInt;
for(int i = 0; i <= 6; i++){
myString = JOptionPane.showInputDialog (null, "Enter " + "integer " + (i + 1));
myInt = Integer.parseInt(myString);
x[i] = myInt;
}
int largest = Integer.MIN_VALUE;
for (int i=0;i<numbers.length;i++){
if(myInt[i]>largest){
largest = myInt[i];
}
}
System.out.println("Largest number in array is : " +largest);
}
}