web technology Online Quiz - 120
Description: web technology Online Quiz - 120 | |
Number of Questions: 20 | |
Created by: Aliensbrain Bot | |
Tags: web technology |
XML is Case-Sensitive Language
Given: public static void before() { Set set = new TreeSet(); set.add("2"); set.add(3); set.add("1"); Iterator it = set.iterator(); while (it.hasNext()) System.out.print(it.next() + " "); } Which statements are true?
Given: interface Hungry { void munch(E x); } interface Carnivore extends Hungry {} interface Herbivore extends Hungry {} abstract class Plant {} class Grass extends Plant {} abstract class Animal {} class Sheep extends Animal implements Herbivore { public void munch(Sheep x) {} } class Wolf extends Animal implements Carnivore { public void munch(Sheep x) {} } Which of the following changes (taken separately) would allow this code to compile? (Choose all that apply.)
Given: public static void main(String[] args) { // INSERT DECLARATION HERE for (int i = 0; i <= 10; i++) { List row = new ArrayList(); for (int j = 0; j <= 10; j++) row.add(i * j); table.add(row); } for (List row : table) System.out.println(row); } Which statements could be inserted at // INSERT DECLARATION HERE to allow this code to compile and run? (Choose all that apply.)
Given: 3. import java.util.*; 4. class Business { } 5. class Hotel extends Business { } 6. class Inn extends Hotel { } 7. public class Travel { 8. ArrayList go() { 9. // insert code here 10. } 11. } Which, inserted independently at line 9, will compile? (Choose all that apply.)
Which is true? (Choose all that apply.)
Given: 3. class A { } 4. class B extends A { } 5. public class ComingThru { 6. static String s = "-"; 7. public static void main(String[] args) { 8. A[] aa = new A[2]; 9. B[] ba = new B[2]; 10. sifter(aa); 11. sifter(ba); 12. sifter(7); 13. System.out.println(s); 14. } 15. static void sifter(A[]... a2) { s += "1"; } 16. static void sifter(B[]... b1) { s += "2"; } 17. static void sifter(B[] b1) { s += "3"; } 18. static void sifter(Object o) { s += "4"; } 19. } What is the result?
Given: 3. public class Wind { 4. public static void main(String[] args) { 5. foreach: 6. for(int j=0; j<5; j++) { 7. for(int k=0; k< 3; k++) { 8. System.out.print(" " + j); 9. if(j==3 && k==1) break foreach; 10. if(j==0 || j==2) break; 11. } 12. } 13. } 14. } What is the result?
Given: 3. public class TestDays { 4. public enum Days { MON, TUE, WED }; 5. public static void main(String[] args) { 6. for(Days d : Days.values() ) 7. ; 8. Days [] d2 = Days.values(); 9. System.out.println(d2[2]); 10. } 11. } What is the result? (Choose all that apply.)
Given the proper import statement(s), and 13. PriorityQueue pq = new PriorityQueue(); 14. pq.add("2"); 15. pq.add("4"); 16. System.out.print(pq.peek() + " "); 17. pq.offer("1"); 18. pq.add("3"); 19. pq.remove("1"); 20. System.out.print(pq.poll() + " "); 21. if(pq.remove("2")) System.out.print(pq.poll() + " "); 22. System.out.println(pq.poll() + " " + pq.peek()); What is the result?
What is output to the web page on the second access to the same instance of the following JSP? (Choose one.) Chapter 6 Question 2
Chapter 6 Question 2
In the UML notation a class can be represented by
In the UML notation, an object can be represented by
Inheritance relationships are represented in the UML notation by:
Which one is correct?