public void addVideo(String title) { boolean temp = true; for (int i=0; i<10;i++){ System.out.println(i); if (videos[i].title.equals("")) { videos[i].title = title; break; } if (i == 9) { temp = false; } } if (temp == false) { System.out.println("Sorry, the shelves are full"); } }