Q161
Open questionSelect an option to see the answer and solution.
Practice every MCQ with options. Use Show answers when you want the correct option and solution.
179
Questions
9/9
Page
Pick an option on a question to see the right answer and solution.
Q161
Open questionSelect an option to see the answer and solution.
Q162
Open questionSelect an option to see the answer and solution.
Q163
Open questionSelect an option to see the answer and solution.
Q164
Open questionSelect an option to see the answer and solution.
Q165
Open questionSelect an option to see the answer and solution.
Q166
Open questionimport java.util.*;
class Array
{
public static void main(String args[])
{
int array[] = new int [5];
for (int i = 5; i > 0; i--)
array[5 - i] = i;
Arrays.sort(array);
System.out.print(Arrays.binarySearch(array, 4));
}
}Select an option to see the answer and solution.
Q167
Open questionclass Output
{
public static void main(String args[])
{
ArrayList obj = new ArrayList();
obj.add("A");
obj.add("D");
obj.ensureCapacity(3);
obj.trimToSize();
System.out.println(obj.size());
}
}Select an option to see the answer and solution.
Q168
Open questionSelect an option to see the answer and solution.
Q169
Open questionSelect an option to see the answer and solution.
Q170
Open questionSelect an option to see the answer and solution.
Q171
Open questionimport java.util.*;
class Collection_iterators
{
public static void main(String args[])
{
LinkedList list = new LinkedList();
list.add(new Integer(2));
list.add(new Integer(8));
list.add(new Integer(5));
list.add(new Integer(1));
Iterator i = list.iterator();
Collections.reverse(list);
Collections.shuffle(list);
i.next();
i.remove();
while(i.hasNext())
System.out.print(i.next() + " ");
}
}Select an option to see the answer and solution.
Q172
Open questionSelect an option to see the answer and solution.
Q173
Open questionSelect an option to see the answer and solution.
Q174
Open questionSelect an option to see the answer and solution.
Q175
Open questionSelect an option to see the answer and solution.
Q176
Open questionSelect an option to see the answer and solution.
Q177
Open questionimport java.util.*;
class Output
{
public static void main(String args[])
{
ArrayList obj = new ArrayList();
obj.add("A");
obj.add(0, "B");
System.out.println(obj.size());
}
}Select an option to see the answer and solution.
Q178
Open questionSelect an option to see the answer and solution.
Q179
Open questionSelect an option to see the answer and solution.