Instancié tres arreglos de la siguiente forma:
int[] a = new int[9];
int[] b = new int[9];
int[] c = new int[9];
creé tres índices para los arreglos de la siguiente forma:
int ia = 0, ib = 0, ic = 0;
El problema es que si en c[ic] guardo un valor el compilador me suelta "Array required but int found "
, no se que estoy haciendo mal, les dejo el código, de antemano gracias por sus respuestas 
Saludos

Código
import javax.swing.*;
public class clase{
boolean ctp;
int[][] vec = new int[3][3];
int[] a = new int[9];
int[] b = new int[9];
int[] c = new int[9];
int ia = 0, ib = 0, ic = 0;
public clase(int ctrl){
switch(ctrl){
case 1:
sub_principal();
break;
case 2:
sub_numeros();
break;
case 3:
sub_arreglos();
break;
case 4:
System.exit(0);
break;
}
}
public static void Main(String[] args){
}
void sub_principal(){
ctp=true;
while(ctp){
int m = Integer.parseInt(JOptionPane.showInputDialog(null, "1- Ingresar una frase para contar sus caracteres \n\n 2- Ingresar un Nombre para mostrar en minúsculas o mayúsculas \n\n 3- Volver \n\n 4- Salir"));
switch(m){
case 1:
String frase = JOptionPane.showInputDialog(null, "Ingrese una frase");
JOptionPane.showMessageDialog(null, "La frase tiene " + frase.length() + " caracteres");
break;
case 2:
String nombre = JOptionPane.showInputDialog(null, "Ingrese un nombre");
JOptionPane.showMessageDialog(null, nombre.toUpperCase());
break;
case 3:
ctp=false;
break;
case 4:
new clase(4);
break;
}
new clase(1);
}
}
void sub_numeros(){
ctp=true;
while(ctp){
int s = Integer.parseInt(JOptionPane.showInputDialog(null, "1- Ver si el numero es primo \n\n 2- Ver si el numero es perfecto \n\n 3- Calcular MCM entre dos numeros \n\n 4- Volver 5- Salir"));
switch(s){
case 1:
int op = Integer.parseInt(JOptionPane.showInputDialog(null, "Ingrese el numero"));
if (esPrimo(op)){
JOptionPane.showMessageDialog(null, s + "Es primo");
}else{
JOptionPane.showMessageDialog(null, s + "No es primo");
}
break;
case 2:
int op2 = Integer.parseInt(JOptionPane.showInputDialog(null, "Ingrese el numero"));
if (esPerfecto(s)){
JOptionPane.showMessageDialog(null, s + "Es perfecto");
}else{
JOptionPane.showMessageDialog(null, s + "No es perfecto");
}
break;
case 3:
JOptionPane.showMessageDialog(null, "Aun no implementada XD");
break;
case 4:
ctp=false;
break;
case 5:
new clase(4);
break;
}
new clase(1);
}
}
void sub_arreglos(){
ctp=true;
while(ctp){
int in = Integer.parseInt(JOptionPane.showInputDialog(null, "1- Ingresar numeros para la matriz \n\n 2- Volver \n\n 3-Salir"));
switch (in){
case 1:
int c=1;
for (int x=0;x<3;x++){
for (int y=0;y<3;y++){
vec[x][y] = Integer.parseInt(JOptionPane.showInputDialog(null, "Ingrese numero " + c));
c++;
if(vec[x][y]%2==0){
a[ia] = vec[x][y];
ia++;
}else if (vec[x][y]%2!=0){
b[ib] = vec[x][y];
ib++;
}
if (vec[x][y]<0){
c[ic] = vec[x][y];
ic++;
}
}
}
String pares="";
for (int valor:a){
pares += "[" + Integer.toString(valor) + "]";
}
JOptionPane.showMessageDialog(null, "Los numeros pares son \n\n" + pares);
String impares="";
for (int valor:a){
impares += "[" + Integer.toString(valor) + "]";
}
JOptionPane.showMessageDialog(null, "Los numeros impares son \n\n" + impares);
String negativos="";
for (int valor:a){
negativos += "[" + Integer.toString(valor) + "]";
}
JOptionPane.showMessageDialog(null, "Los numeros negativos son \n\n" + negativos);
break;
case 2:
ctp = false;
break;
case 3:
new clase(4);
break;
}
}
new clase(1);
}
boolean esPrimo(int p){
int c;
for (int x=p;x>0;x--){
if (p%x==0){
c++;
}
}
if (c==2){
return true;
}else{
return false;
}
}
boolean esPerfecto(int p){
int res=0;
for(int y=1;y<=p/2;y++){
if (p%y==0){
res = res + y;
}
}
if (res == p) {
return true;
}else{
return false;
}
}
}










Autor



En línea


