- 1
What is array?
how we can declar an array?
4 Answers
+ 3
آرایه، مجموعه ای از دیتاتایب های مشابه میباشد. مثلا:
{ 1, 2 , 3, 4...}
طریقه تعریف:
Int [] nums = new int [10];
+ 1
Its a collection of certain data type under same variable
int[5]arr; //it'll declare an array of int with size of 5, named arr
+ 1
thanks
+ 1
You might have heard that array store values of same type under same name.
But this is not actually true in Java. In Java when you declare an array of type Object you can store values of different types also.
So in context of Java...the correct definition of array would be "an array is a data structure which stores elements of same or different types at contiguous location"
Note that the word contiguous is important