answersLogoWhite

0


Best Answer

That really depends on the programming language. In Java, the answer is basically "yes", although if you choose the "Object" data type you could probably accomodate different data types.

If you need collections of different data types - again, assuming Java - it is probably better to use some other structures, for better organization. For example, you can organize different data types into an object. Then you can collect various of those in an array. As an example, you can create an array of objects of a class "Person"; and you this class so that each Person has an age (type int), a name (type String), and any other information you need for your specific application.

User Avatar

Wiki User

11y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: Do all elements in a multidimensional array have the same data type?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Continue Learning about Engineering

What conditions must be satisfied by the entire elements of any given array?

All elements of any given array must satisfy the same data type requirement, meaning they should be of the same data type for the array to be well-defined and properly utilized.


What is the connection of an array in data structure?

Both are aggregates of elements of the same type. The main difference is that an array allocates elements contiguously thus there is no need to maintain links between the elements; each can be addressed by its offset from the start of the array. A structure, however, allocates elements non-contiguously, and must maintain links (pointers or references) within the elements in order to navigate from one element to the next.


What is a homogeneous data structure and why is this a weakness for RDBMS?

in homogeneous data structure all the elements of same data types known as homogeneous data structure. example:- array


Application of array in data structure?

That rather depends on the underlying type. For any given type T, an array of type T is user-defined if T is user-defined, otherwise it is built-in. For example: #include<string> // required to use std::string std::string s[42]; // user-defined array int i[42]; // built-in array Here, s is a user-defined array because std::string is a user-defined type, whereas i is a built-in array because int is a built-in type.


An array is a list of data items that all have the same type and the same name?

An array element has the same type as the array name.

Related questions

What is the difference between an array and structure?

An array is a collection of related data elements of same type.Structure can have elements of different types.An array is a derived data type.A structure is a programmer-defined data type.A struct can contain multiple data types, whereas an array can not.


What conditions must be satisfied by the entire elements of any given array?

All elements of any given array must satisfy the same data type requirement, meaning they should be of the same data type for the array to be well-defined and properly utilized.


What an array?

An array is an aggregate of data elements of the same type. Arrays are allocated in contiguous memory. An element of an array can be another array type, also known as a multi-dimensional array.


What is a homogeneous data structure and why is this a weakness for RDBMS?

in homogeneous data structure all the elements of same data types known as homogeneous data structure. example:- array


What is the connection of an array in data structure?

Both are aggregates of elements of the same type. The main difference is that an array allocates elements contiguously thus there is no need to maintain links between the elements; each can be addressed by its offset from the start of the array. A structure, however, allocates elements non-contiguously, and must maintain links (pointers or references) within the elements in order to navigate from one element to the next.


Application of array in data structure?

That rather depends on the underlying type. For any given type T, an array of type T is user-defined if T is user-defined, otherwise it is built-in. For example: #include<string> // required to use std::string std::string s[42]; // user-defined array int i[42]; // built-in array Here, s is a user-defined array because std::string is a user-defined type, whereas i is a built-in array because int is a built-in type.


What is the improved array definition?

An array is used to store data having the same data type.


An array is a list of data items that all have the same type and the same name?

An array element has the same type as the array name.


What is array Explain with syntax?

an array is a collection of the same data type.


Why should all of the elements in an array have the same data type?

Yes all of the elements in array must be the same type. Because when you define an array you specify the type of data it will hold. Examples in C: int IntArray[10]; // an array of 10 integers double FloatArray[20]; // array of 20 double floating point numbers


What is non linear array?

What is ARRAY, explain its typesARRAY: -It is the combination of same data type or if same data is needed more then none time then we use array.Types Normally there are two types of array.(1) One dimensional array(2) Two dimensional array(1) One dimensional array: -This array is in form a list (vertical\Horizontal) the data input output or process in one dimensional array with the help of loop.The syntax of one dimensional array will be as:Array name [strength]For exampleA [5];The structure of above syntax will be as:A (0)A (1)A (2)A (3)A (4)(2) Two dimensional array: -Two dimensional array is also called a table because it consist of rows and columns. The syntax of two dimensional arrays will be as:Data type array name [rows] [columns]For exampleInt [3] [2];The structure of above syntax will be as:A [0] [0] A [0] [1]A [1] [0] A [1] [1]A [2] [0] A [2] [1]The data input output are process in this array with the help of nested loop.


What distinguishes an array from a structure?

Am array is an aggregate of elements that must be of the same type. A structure is an aggregate of elements (members) that can be of different types.