+ 2

What's java equivalence for Python tuples?

Tuples in java

5th Nov 2018, 5:56 AM
Mukhtar Sabiu
Mukhtar Sabiu - avatar
6 odpowiedzi
+ 6
I will say that over the years, Java, as a language, has been slow to evolve and adopt new improvements when compared to C#. Perhaps Java will eventually pick this up since tuples are now supported with C# 7.0. https://docs.microsoft.com/en-us/dotnet/csharp/tuples
5th Nov 2018, 6:15 AM
David Carroll
David Carroll - avatar
+ 5
While custom Java classes could be written to implement similar immutable qualities as Python tuples, I'm not aware of any native support for this in Java.
5th Nov 2018, 6:11 AM
David Carroll
David Carroll - avatar
+ 4
Tuples? As in, in unmodifiable lists? Well why? You could just use an Array right?
5th Nov 2018, 6:02 AM
👑 Prometheus 🇸🇬
👑 Prometheus 🇸🇬 - avatar
+ 2
Sure, array could work.
5th Nov 2018, 6:07 AM
Mukhtar Sabiu
Mukhtar Sabiu - avatar
+ 1
Wow, I'll check that of c#, thanks man. This is so helpful.
5th Nov 2018, 6:18 AM
Mukhtar Sabiu
Mukhtar Sabiu - avatar
10th Nov 2018, 5:04 PM
Mukhtar Sabiu
Mukhtar Sabiu - avatar