Multiple Choice
What is the output of the following statements? ArrayList<String> cityList = new ArrayList<String>() ;
CityList.add("London") ;
CityList.add("New York") ;
CityList.add("Paris") ;
CityList.add("Toronto") ;
CityList.add("Hong Kong") ;
CityList.add("Singapore") ;
System.out.print(cityList.size() ) ;
System.out.print(" " + cityList.contains("Toronto") ) ;
System.out.print(" " + cityList.indexOf("New York") ) ;
System.out.println(" " + cityList.isEmpty() ) ;
A) 5 true 1 false
B) 6 true 2 false
C) 5 false 1 false
D) 6 true 1 false
Correct Answer:

Verified
Correct Answer:
Verified
Q12: Which one of the following statements is
Q13: What will be printed by the statements
Q14: Assume the array of integers values has
Q18: Consider the following code snippet. Which statement
Q19: What is the value of the cnt
Q20: Consider the following code snippet: ArrayList<Double> somedata
Q21: When a Java program terminates and reports
Q22: What is the output of the code
Q27: Suppose you wish to use an array
Q77: What is the result of the following