0 votes
in JAVA by
Can I write my own container class and use it in the for-each loop?

1 Answer

0 votes
by

Yes, you can write your own container class. You need to implement the Iterable interface if you want to loop over advanced for loop in Java, though. If you implement Collection then you by default get that property.

Related questions

0 votes
asked Jan 27, 2020 in JAVA by rahuljain1
0 votes
asked Apr 11, 2020 in SAP by amita rallin
...