answersLogoWhite

0


Best Answer

In Java:

Not as primitives; but I believe you could create an array of Objects, and then initialize the elemnets as subtypes of the Object class, i.e., any class. I don't think this would be very practical (in Java); if (for example) you need to store information about people's names with their ages, create a class called "Person" that has those two attributes, then create an array of Persons.

In Java:

Not as primitives; but I believe you could create an array of Objects, and then initialize the elemnets as subtypes of the Object class, i.e., any class. I don't think this would be very practical (in Java); if (for example) you need to store information about people's names with their ages, create a class called "Person" that has those two attributes, then create an array of Persons.

In Java:

Not as primitives; but I believe you could create an array of Objects, and then initialize the elemnets as subtypes of the Object class, i.e., any class. I don't think this would be very practical (in Java); if (for example) you need to store information about people's names with their ages, create a class called "Person" that has those two attributes, then create an array of Persons.

In Java:

Not as primitives; but I believe you could create an array of Objects, and then initialize the elemnets as subtypes of the Object class, i.e., any class. I don't think this would be very practical (in Java); if (for example) you need to store information about people's names with their ages, create a class called "Person" that has those two attributes, then create an array of Persons.

User Avatar

Wiki User

14y ago
This answer is:
User Avatar
More answers
User Avatar

Wiki User

14y ago

In Java:

Not as primitives; but I believe you could create an array of Objects, and then initialize the elemnets as subtypes of the Object class, i.e., any class. I don't think this would be very practical (in Java); if (for example) you need to store information about people's names with their ages, create a class called "Person" that has those two attributes, then create an array of Persons.

This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: Could array may have elements that are numbers and strings?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Continue Learning about Engineering

Write javascript code to display a list of strings?

You need to put the strings in an array, and then loop through the array to output the strings. Something like this would be a simple example: ---------------- var strings = ["s1","s2","s3"]; for ( var i in strings ) { document.write( strings[i] ); }


How do you find missing numbers in a array with elements below its size?

Please rephrase your question. An array usually has a fixed size and I don't recall ever having to "go below its size". This implies that the missing elements are not within the range of the array.


What is mean by Extra key inserted at the end of Array?

It means the array has a sentinel to mark the end of the array. Any elements that follow the sentinel element are deemed invalid. Sentinels are usually denoted with a special value that is not used by any of the elements that precede it. Null-terminated strings are an example, where the NULL character (ASCII code 0) marks the end of a character array.


Java program to solve lucky number?

Look at the definition, http://en.wikipedia.org/wiki/Lucky_number , then create an array of integers and start working on it. The sieve method requires you to eliminate certain numbers; you can either replace the eliminated array elements with a marker, or move the non-eliminated elements towards the beginning of the array (overwriting the eliminated elements), or perhaps copy to a different array - depending on whether you want simplicity in programming (putting a marker, such as 0, is probably easier to program), or efficiency.Look at the definition, http://en.wikipedia.org/wiki/Lucky_number , then create an array of integers and start working on it. The sieve method requires you to eliminate certain numbers; you can either replace the eliminated array elements with a marker, or move the non-eliminated elements towards the beginning of the array (overwriting the eliminated elements), or perhaps copy to a different array - depending on whether you want simplicity in programming (putting a marker, such as 0, is probably easier to program), or efficiency.Look at the definition, http://en.wikipedia.org/wiki/Lucky_number , then create an array of integers and start working on it. The sieve method requires you to eliminate certain numbers; you can either replace the eliminated array elements with a marker, or move the non-eliminated elements towards the beginning of the array (overwriting the eliminated elements), or perhaps copy to a different array - depending on whether you want simplicity in programming (putting a marker, such as 0, is probably easier to program), or efficiency.Look at the definition, http://en.wikipedia.org/wiki/Lucky_number , then create an array of integers and start working on it. The sieve method requires you to eliminate certain numbers; you can either replace the eliminated array elements with a marker, or move the non-eliminated elements towards the beginning of the array (overwriting the eliminated elements), or perhaps copy to a different array - depending on whether you want simplicity in programming (putting a marker, such as 0, is probably easier to program), or efficiency.


What are Array variables also called as?

Elements of the array.

Related questions

An array may have some elements that are numbers and other that are strings?

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


What is the difference between numeric array and associative array?

Numeric array has numbers(+integers) that represent the values Associative array has strings that represent the values


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 are index numbers used for?

Identifying array-elements.


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 can two single dimensional array values be stored in a third single dimensional array?

You need to create a new array with enough elements to cater for both arrays. Thus if the first array has 10 elements and the second has 5, you must create a 15 element array to store both. You then copy elements from the first array into the third and immediately follow with the elements from the second. Note that the first two arrays must be of the same type. You cannot combine an array of numeric values with an array of strings, for instance.


Write javascript code to display a list of strings?

You need to put the strings in an array, and then loop through the array to output the strings. Something like this would be a simple example: ---------------- var strings = ["s1","s2","s3"]; for ( var i in strings ) { document.write( strings[i] ); }


How do you find missing numbers in a array with elements below its size?

Please rephrase your question. An array usually has a fixed size and I don't recall ever having to "go below its size". This implies that the missing elements are not within the range of the array.


What is array literal in as2?

An array literal is a comma-separated list of the elements of an array. An array literal can be used for initializing the elements of an array.


What is mean by Extra key inserted at the end of Array?

It means the array has a sentinel to mark the end of the array. Any elements that follow the sentinel element are deemed invalid. Sentinels are usually denoted with a special value that is not used by any of the elements that precede it. Null-terminated strings are an example, where the NULL character (ASCII code 0) marks the end of a character array.


What is the array of string in c?

A string in C is stored in a 1 dimension array so an array of strings is simply a two dimension array.


Java program to solve lucky number?

Look at the definition, http://en.wikipedia.org/wiki/Lucky_number , then create an array of integers and start working on it. The sieve method requires you to eliminate certain numbers; you can either replace the eliminated array elements with a marker, or move the non-eliminated elements towards the beginning of the array (overwriting the eliminated elements), or perhaps copy to a different array - depending on whether you want simplicity in programming (putting a marker, such as 0, is probably easier to program), or efficiency.Look at the definition, http://en.wikipedia.org/wiki/Lucky_number , then create an array of integers and start working on it. The sieve method requires you to eliminate certain numbers; you can either replace the eliminated array elements with a marker, or move the non-eliminated elements towards the beginning of the array (overwriting the eliminated elements), or perhaps copy to a different array - depending on whether you want simplicity in programming (putting a marker, such as 0, is probably easier to program), or efficiency.Look at the definition, http://en.wikipedia.org/wiki/Lucky_number , then create an array of integers and start working on it. The sieve method requires you to eliminate certain numbers; you can either replace the eliminated array elements with a marker, or move the non-eliminated elements towards the beginning of the array (overwriting the eliminated elements), or perhaps copy to a different array - depending on whether you want simplicity in programming (putting a marker, such as 0, is probably easier to program), or efficiency.Look at the definition, http://en.wikipedia.org/wiki/Lucky_number , then create an array of integers and start working on it. The sieve method requires you to eliminate certain numbers; you can either replace the eliminated array elements with a marker, or move the non-eliminated elements towards the beginning of the array (overwriting the eliminated elements), or perhaps copy to a different array - depending on whether you want simplicity in programming (putting a marker, such as 0, is probably easier to program), or efficiency.