Skip to main content
  1. About
  2. For Teams

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

Tuple in Java lang

I would like to do something with Java like Python.

data = [
    ('1','One'),
    ('2','Two'),
    ('3','Three')
] # Please, Java, how can do that ?

### List<Integer, Double> data = new ArrayList<Integer, Double>() ???
### Or
### ArrayList<Integer, Double> data = new ArrayList<>() ????
## Or more ???

for datium in data:
    print(f"{datium[0]} - {datium[1]}")

Please help.

Answer*

Cancel

Morty Proxy This is a proxified and sanitized view of the page, visit original site.