What does the following code do in Java:
for(JCheckBox check : Devices.selectedDevices)
I just want to be able to understand this and be a better developer
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
This is called as for-each (or) enhanced for loop in java.
It means for each JCheckbox in selectedDevices array (or) collection.