answersLogoWhite

0


Best Answer

No, but an arraylist or almost any other list abstraction can

User Avatar

Wiki User

14y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: An array may have some elements that are numbers and other that are strings?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

What is difference between structure and array?

An array is a made up of elements of the same type e.g. strings or integers. A structure on the other hand can be made up of elements of different types.


What does the word array mean in math?

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.


How you pass array elements to a function?

Passing array elements to a function is achieved by passing the individual elements by reference or by value, just as you would any other variable. However, passing the entire array requires that you pass a pointer-to-pointer to the array along with the dimension(s) of the array.


What is an array for 2 times 3?

An array of 2 times 3 is a one-dimensional array of 2 elements each of which is a one-dimensional array of 3 elements. In other words, it is an array of arrays, also known as a two-dimensional array. We can imagine a two dimensional array as being a table with rows and columns. A 2 times 3 array has 2 rows and 3 columns. Each row is itself an array of 3 elements. However, we can also say that each column is an array of 2 elements.


How do you reverse the order of the elements in the array?

Start by pointing to each end of the array. Work your way towards the middle of the array, swapping elements as you go. When the pointers meet or pass each other, the array is completely reversed.


What is an array of 5 x 46?

An array is a contiguous memory allocation divided into one or more elements of equal size. A 5 x 46 array is an array of 5 elements where each element is another array of 46 elements. In other words it is an array of arrays. We can the array a two-dimensional array because it has 5 elements in one dimension (the rows) and 46 in the other dimension (the columns). If an individual column element is 4 bytes long, then each row element consumes 46 x 4 = 184 bytes of memory while the entire array consumes 5 x 184 = 920 bytes in total. We can also think of the entire array as being a one-dimensional array of 5 x 46 = 320 elements of 4 bytes each.


What is the characteristics of a rectangular array?

It is an array of m*n numbers or other objects that are arranged in m rows and n columns, where m and n are integers.


How do you initialize an array variable in java program?

An array in java is a collection of items stored into a single unit. The array has some number of slots (elements), each slot in the array can hold an object or a primitive value. Arrays in java are objects that can be treated just like other objects in the languageArrays can contain any type of element value , but we can't store different types in a single array. We can have an array of integers or an array of strings or an array of arrays.To create an array in java ,use three steps1. Declare a variable to hold the array2. Create a new array object and assign it to the array variable3. Store things in that array


How will you initialize a 2-d array?

All arrays are one-dimensional. A two-dimensional array is simply a one-dimensional array of one-dimensional arrays: int a[2][3]; This is an array of 2 elements where each element is itself an array of 3 integers. In other words it is an array of 6 integers. The two dimensions simply allow us to split the array into two sub-arrays of 3 elements each.


What is the difference between a string and an array?

Nothing whatsoever. A string is simply an array of type char. In some programming languages, such as C, a string is an array of char (or short), terminated with a null \0. An array is just a fixed size of collection, a container to hold things/objects. If all the elements in the container are characters (of char), then we may call it a string, sometimes a byte array (because each character can be represented as a byte). An array of 7 different days, it maybe a WEEK, or just the birthdays of 7 dwarfs. Then they are nothing to do with strings. A data item (or variable) is described as a "string" type when it contains some number of characters. Those characters can usually be anything in the system's accepted list of codes. Most systems use ASCII, so a string can include the letters a-z, A-Z, numbers 0-9, and special characters like ~!@#$%^&*()_+-=[]\{}|:";'<>?,/. A string is treated as a single object, although most programming languages have methods to break strings apart (called sub-stringing). In the Perl language, strings are named $something. An array is a collection of individual data items, sort of like a list. Each element in an array can be referred to in a program by its position in the list. In the Perl language, an array would be named @SOMETHING. The first element in the array would be named $SOMETHING[0], the second $SOMETHING[1], and so on. Each element can be a string, or some other data type. Other data types would be integers (positive or negative whole numbers), floating point (decimal numbers like 3.14159 or 2398.41; it can be more complicated than this, but that's another story), and a few more exotic types. In the C programming language a string is actually the same as an array of characters. The last character in a C string is a zero byte which indicates the end of the string.


Can you change the size of an array dynamically in Java?

No, you can't change the size of an array dynamically. If you are needing to change the size of an array dynamically use an ArrayList, LinkedList, ConcurrrentHashMap, or another class that meets your needs.


Difference between integer array and character array?

Arrays are basic structures wherein one or more elements exist "side by side" and are of the same "type". An "integer" array is an array whose elements are all of an integer type which has no fractional component. A "character" array is an array which contains nothing but character types. A "floating point" array contains elements that have both an integer and fractional portion. Simply put, they are arrays of particular types.