congugative memory allocation ,is use to array
Elements of the array.
Simple non-array variables are usually passed to methods by value.
Object array is called universal array because it can store multiple variables of the same type
Full representation of an array begins from the index 0 and ends at n-1 where n is the number of variables of the array.
Yes. Using an array when multiple elements need to be created at a time is always a better idea than declaring multiple variables. For ex: Int i, j, k; Int[] arr; I have declared 3 int variables and another array just below it. Here since we are using only 3 variables, we can manage to use them without issues but if the number crosses 5 or even more then definitely using an array is always the best option.
Elements of the array.
Simple non-array variables are usually passed to methods by value.
Unlike ordinary variables, the variables within an array do not have any names; they are anonymous. To access them you need to use memory offsets from the start of the array. Since the elements of an array are all the same type they are also the same length, thus the offsets are equal to the length of the array type. However, there is no need to calculate the offsets because each element's offset has a zero-based index. Thus the second element can be found at offset index 1.
Object array is called universal array because it can store multiple variables of the same type
Full representation of an array begins from the index 0 and ends at n-1 where n is the number of variables of the array.
Yes. Using an array when multiple elements need to be created at a time is always a better idea than declaring multiple variables. For ex: Int i, j, k; Int[] arr; I have declared 3 int variables and another array just below it. Here since we are using only 3 variables, we can manage to use them without issues but if the number crosses 5 or even more then definitely using an array is always the best option.
For global/static variables: yes.For auto variables: no.
the example of array over charcter variables is char ["string"]
An array is a set of numbers that form some sort of regular arrangement. A linear array is a 1-dimensional array consisting of a row or a column of a set of numbers. A 2-dimensional array is a rectangular arrangement of numbers. And there are arrays with higher dimensions. The elements of an array need not be numbers: they could be variables, functions or expressions. In other words, it's a picture to describe a multiplication problem.
You can use unlimited number of variables for a structure and you can also declare array of structures.
Arrays are important because we often need to work with a collection of variables of the same type and, particularly with large collections, it would be impractical to declare and name each one individually. With an array we don't have to name them because the variables are allocated in contiguous memory addresses and every element is the same length. Knowing only the start address of the array and the zero-based index of an element we gain constant-time random access to any element in the array. An array is really just an extension of a type. When we declare a variable of a given type we allocate sufficient memory to hold just one object of that type. With an array, we can allocate as many objects as we require.
An array is a list of data items or variables of the same type, like a list of numbers or a list of dates or a list of names.