Ragged and Jagged Arrays

前端 未结 4 1827
情书的邮戳
情书的邮戳 2021-02-07 12:42

What is the difference between ragged and jagged arrays? As per my research both have the same definitions, i.e. two-dimensional arrays with different column lengths.

4条回答
  •  渐次进展
    2021-02-07 13:46

    Your question already says the correct answer ^^ but for completeness.

    A Jagged or also called Ragged array is a n-dimensional array that need not the be reactangular means:

    int[][] array = {{3, 4, 5}, {77, 50}};
    

    For more examples you could look here and here!

提交回复
热议问题