在Java中使用for循环 for(feature city : cities)
在Java中使用for循环 for(feature city : cities)
这个问题已经有答案了:
我正在开发一个将数据读入列表的项目。在for循环中,我有一个问题。特性city:cities是如何工作的?我知道cities是一个列表,但city是什么意思?city没有预定义,Java如何理解city?
List cities = GeoJSONReader.loadData(this, cityFile); cityMarkers = new ArrayList(); for(Feature city : cities) { cityMarkers.add(new CityMarker(city)); }
admin 更改状态以发布 2023年5月23日