What does this for(:) mean in Java?

前端 未结 2 886
醉梦人生
醉梦人生 2021-01-17 06:22
package MyTest;

import java.beans.BeanInfo;
import java.beans.Introspector;
import java.beans.PropertyDescriptor;

class Person {
...
}

class Student extends Perso         


        
2条回答
  •  执笔经年
    2021-01-17 06:42

    It's a for-each loop over the Collection "props". It iterates over all entries of the collection. During each loop iteration, "prop" is the currently processed entry. You can do that with any container class which implements Iterable as well as arrays.

提交回复
热议问题