When compiling this java program, I get errors like cannot find symbol... any suggestions? 

```
import java.io.*;
import java.util.Scanner; 

public class joel001
{
    public int d;

// find the smallest number of an array
public static int small(int a[])  
{

    int smallest=0;
    for(int i=0;i<a.length();i++)
    {
        if(a[i]<smallest)
        {
            smallest=a[i];
        }
    }
    return smallest;
}

// subtract the smallest number of an array from all its elements
public static int[] sub(int a[],int d)
{
    this.d=d;
    for(int i=0;i<a.length();i++)
    {    
        a[i]=a[i]-d;
    }
    return a;
}

// count the array's non zero elements
public static int count(int a[])
{
    int countn=0;
        for(int i=0;i<a.length();i++)
        {
            if(a[i]!=0)
            {   
            countn=countn+1;
            }   
        }
    return countn;
}

public static void main(String args[])
{
    int b,c,z,k=1;
    int a[]=new int[1000];

    Scanner s=new Scanner(System.in);   
    b=s.nextInt();           //input
    for(i=0;i<b;i++)
    {
        a[i]=s.nextInt();
    }
    while(k==1)
    {
        z=count(a);
        if(z==0)
        {
            break;
        }
    System.out.println(z);
    c=small(a);
    a=sub(a,c);
    }
}
}

```