Answers for "for loop object in objects java"

3

java loop object

MyObject objects[] = new MyObject[6];
for (MyObject o: objects) {

    o = new MyObject();
}

MyObject objects[] = new MyObject[6];
for(int i = 0; i < objects.length; i++) {

    objects[i] = new MyObject();
}
Posted by: Guest on February-14-2020

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language