MCQs > IT & Programming > Java > Output of the following code? import java.util.*; public class Test { public static void main (String args[]) throws Exception { List l = new ArrayList (); int a = (int)(3 * 2.5); for (int i = 0; i < 10; i++) l.add (i); String s = 'Hello'; l.add (a, s.getBytes ('UTF-8')[2]); System.out.println (l); } }

Java MCQs

What will be the output of the following code?

import java.util.*;
public class Test
{
public static void main (String args[]) throws Exception
{
List l = new ArrayList ();
int a = (int)(3 * 2.5);
for (int i = 0; i < 10; i++)
l.add (i);
String s = "Hello";
l.add (a, s.getBytes ("UTF-8")[2]);
System.out.println (l);
}
}

Answer

Correct Answer: [0, 1, 2, 3, 4, 5, 6, 108, 7, 8, 9]

Explanation:

Note: This Question is unanswered, help us to find answer for this one

Java Skill Assessment

Overall Skill Level-Poor

Your Skill Level: Poor

Retake Quizzes to improve it

search

Java Skill Assessment

Overall Skill Level-Poor

Your Skill Level: Poor

Retake Quizzes to improve it