Arrays in Java are not resizable, so you need to allocate enough size initially:
int e[] = new int[10];
int n[] = new int[10];
int o[] = new int[10];
Also, you mixed up even and odd numbers. It should be:
if (a[i] % 2 == 0 && a[i] > 0 ){
e[x] = a[i];
x++;
}
if (a[i] % 2 != 0 && a[i] > 0 ){
o[y] = a[i];
y++;
}
Also, you have a typo when storing negative number. Shuld be:
if (a[i] < 0){
n[z] = a[i];
z++;
}
And finally you cannot output array as you do. Should be:
System.out.println("Even numbers: " + Arrays.toString (e));
System.out.println("Odd numbers: " + Arrays.toString (o));
System.out.println("Negative numbers: " + Arrays.toString (n));
Here is how I would do this:
public static void main(String[] args) {
List <Integer> e = new ArrayList<> ();
List <Integer> o = new ArrayList<> ();
List <Integer> n = new ArrayList<> ();
Scanner s = new Scanner(System.in);
for (int i = 0; i < 10; i++)
{
System.out.println("Enter the number");
int a = s.nextInt ();
if (a > 0)
{
if (a % 2 == 0) e.add (a);
else o.add (a);
}
else n.add (a);
}
System.out.println("Even numbers: " + e);
System.out.println("Odd numbers: " + o);
System.out.println("Negative numbers: " + n);
}