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
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.