From 493f8daa875751caa5213e05d3e9f3f428a080ad Mon Sep 17 00:00:00 2001 From: Harsh Nayak <35399306+harshnayak97@users.noreply.github.com> Date: Sun, 4 Nov 2018 07:16:49 +0530 Subject: [PATCH] add advantages and disadvantages of array (#20768) * add advantages and disadvantages of array add two advantages and 1 disadvantages of array to the article. * add advantages and disadvantages of array updated the previous commit. --- guide/english/java/arrays/index.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/guide/english/java/arrays/index.md b/guide/english/java/arrays/index.md index 5592b0cf61..3ac618ee56 100644 --- a/guide/english/java/arrays/index.md +++ b/guide/english/java/arrays/index.md @@ -179,5 +179,12 @@ Output: [ 0 | 1 | 2 | 3 | 4 ] ``` +**Advantages of Arrays** +- **Code Optimization**: It makes the code optimized, we can retrieve or sort the data efficiently. ++ **Random access**: We can get any data located at an index position. + +**Disadvantages of Arrays** +- **Size Limit**: We can store only the fixed size of elements in the array. It doesn't grow its size at runtime. To solve this problem, collection framework is used in Java which grows automatically. + #### More Information: * Source: [Java Arrays](https://docs.oracle.com/javase/tutorial/java/nutsandbolts/arrays.html)