Debug this Java program import java.util.*; public class BattleList { public sta
ID: 638271 • Letter: D
Question
Debug this Java program
import java.util.*;
public class BattleList {
public static void main(String args[]) {
// Creating an empty array list
//
ArrayList<String> battles = new ArrayList<String>();
// Add battles to the newly-created arraylist:
//
battles.add("April 12, Battle of Fort Sumter");
battles.add("June 3, Battle of Philippi");
battles.add("June 10, Big Bethel");
battles.add("July 21, First Battle of Bull Run");
battles.add("October 9, Battle of Santa Rosa Island");
battles.add("November 7
Explanation / Answer
import java.util.*;
public class BattleList {
public static void main(String args[]) {
// Creating an empty array list
//
ArrayList<String> battles = new ArrayList<String>();
// Add battles to the newly-created arraylist:
//
battles.add("April 12, Battle of Fort Sumter");
battles.add("June 3, Battle of Philippi");
battles.add("June 10, Big Bethel");
battles.add("July 21, First Battle of Bull Run");
battles.add("October 9, Battle of Santa Rosa Island");
battles.add("November 7
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.