[SOLVED] Array Programming Construct?
I'm working on an assignment for my java class and this is one of my last steps:
"Redo part 2 with an array programming construct instead of an ArrayList."
i hope i don't sound like a complete newb but is an array programming construct ?: Code:
String[] Movies = { "Batman", "Superman", "Spiderman", "Ironman" };
Part2 is a for loop:(sorry if its not formatted correctly idk how to)
Code:
private void intialiseFavMovies()
{
Movies.add("Batman");
Movies.add("Scarface");
Movies.add("Half-Baked");
Movies.add("A Bronx Tale");
Movies.add("Paid In Full");
Movies.add("Home Alone 2");
Movies.add("Goodfellas");
Movies.add("Casino");
Movies.add("Superbad");
Movies.add("Teenage Mutant Ninja Turtles 2");
}
public void doForLoop()
{
Movies = new ArrayList<String>();
intialiseFavMovies();
for (int i = 0; i < Movies.size(); i++) {
System.out.println(Movies.get(i));
}
i hope i explained my problem clearly.