Java programming exercise with solution : find the number which has the largest number of divisor

Exercise:
Find the number between 0 to 1000 that has the largest number of divisors and show how many divisor does it has.

Result:
840 is the number that has the largest number of divisors.
It has 32 divisors.

Solution:

package yasolution.org.java;

public class FindNumDivisor {

 /**
  * YaSolution
  */
 public static int numberDivisor(int a) {
  int number = 0;
  for (int i = 1; i < a + 1; i++) {
   if (a % i == 0)
    number++;
  }
  return number;
 }

 public static void main(String[] args) {
  // TODO Auto-generated method stub

  int maxDivisor = 0;
  int n = 0;

  for (int i = 1; i < 1001; i++) {
   if (maxDivisor < numberDivisor(i)) {
    maxDivisor = numberDivisor(i);
    n = i;
   }
  }

  System.out.println(n
    + " is the number that has the largest number of divisors");
  System.out.println("It has " + numberDivisor(n) + " divisors.");
 }

}

Feel free to comment below.