Arrays in java | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

Arrays in java

Cn someone explain what are these and are they used for??

8th Sep 2021, 7:52 AM
Phantom
2 Answers
+ 5
•Array is used to store a similar type of data. •An array is a contiguous collection of homogeneous elements that can be accessed using an index. •array is allocated on the heap •arrays in java store one of two things: either primitive values (int, char, …) or references (a.k.a pointers). when an object is creating by using “new”, memory is allocated on the heap and a reference is returned. •Arrays of char is also known as string.
8th Sep 2021, 8:01 AM
Saurabh
Saurabh - avatar
+ 4
You just completed 4% of the java course, I'll recommend you to keep patience and continue learning. https://docs.oracle.com/javase/tutorial/java/nutsandbolts/arrays.html
8th Sep 2021, 8:01 AM
Rupali Haldiya
Rupali Haldiya - avatar