public class Example2
{
public static void main(String[] args)
{
double array[] = new double[6];
array[0] = 9.8;
array[1] = 4.8;
array[2] = 5;
array[3] = 7.0088;
System.out.println(array.length);
for (int i = 0; i < array.length; i++)
{
System.out.println(array[i]);
}
}
}
Week2-09-Example2使用array.length 输出数组
![](https://img-home.csdnimg.cn/images/20240711042549.png)