Is there a Java equivalent of Python's 'enumerate' function?

前端 未结 11 587
别那么骄傲
别那么骄傲 2020-12-08 01:59

In Python, the enumerate function allows you to iterate over a sequence of (index, value) pairs. For example:

>>> numbers = [\"zero\", \"one\", \"tw         


        
11条回答
  •  一生所求
    2020-12-08 02:04

    No. Maybe there are some libraries for supporting such a functionality. But if you resort to the standard libraries it is your job to count.

提交回复
热议问题