Type of List to Store Multipe Data Types

前端 未结 3 1734
情话喂你
情话喂你 2021-01-13 21:22

So my problem is that I\'ve written a function that takes two Doubles, two Int, and a Calendar object on Android (Java). I believe the class provided to allow it to run in a

3条回答
  •  庸人自扰
    2021-01-13 21:47

    So you're really looking for the answer to the wrong question. The problem you're having isn't the one you've described but the fact that you're needing to ask it. In other words, if it feels like you're doing something wrong or trying to fit a square peg into a round hole it's because you probably are. If you have complete control over the code look for alternative methods of implementing to gain your desired results. I'm 100% sure that the naive solution, a list that holds Objects is bad. :) Good luck.

提交回复
热议问题