Arrays of different types

0 votes

Is it possible to have an array with two distinct sorts of data in it? A double and a string should both be included in my array. I tried to

ArrayList<double><String> array;

However, it failed.

Sorry for the dumb inquiry, but I haven't used something similar in a while. Could you remind me how I would declare and fill such an array?

Then, to go one step further, is it possible to sort the array by the double?

Aug 8 in Java by krishna
• 2,640 points
33 views

No answer to this question. Be the first to respond.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.

Related Questions In Java

0 votes
2 answers

What are the different types of constructor in StringBuilder class?

StringBuilder  we 4  as mentioned below. READ MORE

answered Sep 1, 2020 in Java by Sri
• 3,190 points
533 views
0 votes
1 answer

What are the different types of database testing?

The 3 types of Database Testing are Structural ...READ MORE

answered May 9, 2019 in Java by Frankie
• 9,830 points
1,289 views
0 votes
0 answers
0 votes
0 answers

Sort arrays of primitive types in descending order

I got a huge array of double ...READ MORE

Aug 3 in Java by krishna
• 2,640 points
39 views
0 votes
0 answers

How to declare an array of different data types

In Java, I am working with arrays, ...READ MORE

Aug 3 in Java by krishna
• 2,640 points
83 views
0 votes
1 answer

In Java, how to find out the min/max values from array of primitive data types?

import java.util.Arrays; import java.util.Collections; import org.apache.commons.lang.ArrayUtils; public class MinMaxValue { ...READ MORE

answered Jun 12, 2018 in Java by Daisy
• 8,120 points
773 views
+5 votes
4 answers

How to execute a python file with few arguments in java?

You can use Java Runtime.exec() to run python script, ...READ MORE

answered Mar 27, 2018 in Java by DragonLord999
• 8,450 points

edited Nov 7, 2018 by Omkar 64,495 views
+1 vote
1 answer

How to handle drop downs using Selenium WebDriver in Java

First, find an XPath which will return ...READ MORE

answered Mar 27, 2018 in Selenium by nsv999
• 5,500 points
6,836 views
0 votes
1 answer

What are the differences between getText() and getAttribute() functions in Selenium WebDriver?

See, both are used to retrieve something ...READ MORE

answered Apr 5, 2018 in Selenium by nsv999
• 5,500 points
14,625 views
0 votes
1 answer

Selenium JARS(Java) missing from downloadable link

Nothing to worry about here. In the ...READ MORE

answered Apr 5, 2018 in Selenium by nsv999
• 5,500 points
3,199 views
webinar REGISTER FOR FREE WEBINAR X
Send OTP
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP