for (object obj: args) What does it mean

This is the method to iterate,
equivalent to
(1) assuming args an array
for (int I = 0; I <args.length; I ++) {
Object obj = args [I];
}
(2) assuming args is a List
for (int I = 0; I <args.size (); I ++) {
Object obj = args.get (I);
}

Reprinted from https://zhidao.baidu.com/question/74212797.html

Guess you like

Origin blog.csdn.net/tuzi007a/article/details/97181789