programming languages Online Quiz - 107
Description: programming languages Online Quiz - 107 | |
Number of Questions: 20 | |
Created by: Aliensbrain Bot | |
Tags: programming languages |
Given: 11. public static Iterator reverse(List list) { 12. Collections.reverse(list); 13. return list.iterator(); 14. } 15. public static void main(String[] args) { 16. List list = new ArrayList(); 17. list.add(” 1”); list.add(”2”); list.add(”3”); 18. for (Object obj: reverse(list)) 19. System.out.print(obj + “,”); 20. } ‘What is the result?
Given: 11. public static Collection get() { 12. Collection sorted = new LinkedList(); 13. sorted.add(’B”); sorted.add(”C”); sorted.add(”A”); 14. return sorted; 15. } 16. public static void main(String[] args) { 17. for (Object obj: get()) { 18. System.out.print(obj + “, “); 19. } 20. } What is the result?
Program output : package com.collection.examples; import java.util.HashSet; public class HashSetExample { public static void main(String[] args) { HashSet s = new HashSet();//1 for(short i = 0; i<100;i++){ //2 s.add(i); //3 s.remove(i-1); //4 } System.out.println(s.size()); //5 } }
Which of the following options is true for the following program: try { if (choice) { while (true) } else { system .exit(1): } }finally { codetocleanup(); }
Which interface does TreeMap class implement ?
Which of the below is not an implicit object of JSP ?
Which of the below is not an implicit object of JSP ?