什么是柔性阵列? [英] What is a Flexible Array?

查看:188
本文介绍了什么是柔性阵列?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

什么是柔性阵列? 我找不到很多东西.

What is a Flexible Array, exactly? I can't find much on it.

推荐答案

柔性数组是一种数组,其索引范围是在运行时确定的,并且在数组的生存期内可能会发生变化.

A flexible array is an array whose index bounds are determined at run time and may change during the lifetime of the array.

Java数组很灵活.例如,在Java中,您可以将一个数组分配给另一个数组:

Java arrays are flexible. For example, in Java you can assign one array to another:

int[] a1 = {1, 2, 3, 4};
int[] a2 = {1, 2, 3};
a1 = a2;

首先,a1的索引范围为0-3,而a2的索引范围为0-2.

At first, a1 has index range 0–3, and a2 has index range 0–2.

赋值a1 = a2后,a1指向索引范围为0–2的数组,因此a1的索引范围在a1的生存期内发生变化.

After the assignment a1 = a2, a1 points to an array with index range 0–2, so the index range of a1 varied during the lifetime of a1.

这篇关于什么是柔性阵列?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆