Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

What is the output of the following program? import java.util.Vector; public cla

ID: 3529149 • Letter: W

Question

What is the output of the following program? import java.util.Vector; public class Exercise_12 { public static void main(String[] arg) { Vector strList = new Vector () ; Vector intList = new Vector(); strList.addElement("Hello"); intList.addElement(10); strList.addElement("Happy"); intList.addElement(20); strList.addElement("Sunny"); intList.addElement(30); System.out.println("strList: " + strList); System.out.println("intList: " + intList); strList.insertElementAt("Joy", 2); intList.removeElement (20); System.out.println("strList: " + strList); System.out.println("intList: " + intList); } }

Explanation / Answer

it prints hello happy 30 times

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote