请生成一个简单的Java程序，可以计算并输出1~10的平均数。
```
public class Average {
  public static void main(String[] args) {
    int sum = 0;
    for (int i = 1; i <= 10; i++) {
      sum += i;
    }
    double average = sum / 10.0;
    System.out.println("The average is " + average);
  }
}
```