开发者社区 问答 正文

数组与方法互操作中方法接收数组是如何操作的呢?

已解决

数组与方法互操作中方法接收数组是如何操作的呢?

展开
收起
游客4ztx2pti3xtdw 2022-04-02 14:43:37 734 分享 版权
1 条回答
写回答
取消 提交回答
  • 推荐回答

    这个操作我们可以用代码来解释一下: 方法接收数组 public class Test{ public static void main(string[]args){ int[]data=new int[]{1,2,3,4,5}; printArry(data); } public static void printArry(int[]data){ for(int temp:data){ System. out. print(temp+”“); } } //输出12345

    2022-04-02 17:21:42
    赞同 展开评论
问答地址: