0

web technology Online Quiz - 117

Description: web technology Online Quiz - 117
Number of Questions: 20
Created by:
Tags: web technology
Attempted 0/20 Correct 0 Score 0
  1. Page Handler

  2. Action Controller

  3. JSP

  4. Javascript


Correct Option: A
  1. ec_debug.jsp->Configuration->DomainData->LifeHost

  2. ec_debug.jsp->DomainData->Host.xml

  3. using wasops

  4. ec_debug->Jars->Registered Components->DomainData->Host


Correct Option: A
  1. The before() method will print 1 2

  2. The before() method will print 1 2 3

  3. The before() method will print three numbers, but the order cannot be determined

  4. The before() method will not compile

  5. The before() method will throw an exception at runtime


Correct Option: E

Which architecture does PS framework follow

  1. Hibernate Architecture

  2. Struts Architecture

  3. MVC Architecture

  4. Web Architecture


Correct Option: C

In the UML notation, parameterized (generic) classes are represented by

  1. the normal class representation with a dotted arrow pointing at the template parameter classes

  2. the normal class representation but shaded grey.

  3. the normal class representation with a dotted outline and the names of its parameter classes listed on the top right-hand corner.

  4. the normal class representation with a rectangular box in its top left-hand corner.

  5. Its a trick question - parameterized classes can't be specified in the UML notation.


Correct Option: C

Which of the following are true statements about the JavaServer Page life cycle? (Choose two.)

  1. The _jspService() method is called from the generated servlet's service() method.

  2. jspInit() is only ever called on the first request to a JSP instance.

  3. jspDestroy() is only ever called on the last request to a JSP instance.

  4. All servlet methods are accessible from the jspInit() method.

  5. You cannot override or provide a no-parameter init() method in a JSP page.


Correct Option: A,D
  1. A request is sent with the HTTP method HEAD.

  2. A request is sent with the HTTP method POST.

  3. A request is sent with the HTTP method GET.

  4. The parameter fullName is the only parameter passed to the web server in the request URL.

  5. The parameters fullName and sbmButton are passed to the web server in the request URL.

  6. The parameter fullName is the only parameter passed to the web server as part of the request body.


Correct Option: C,F

Which of the following are valid servlet methods that match up with HTTP methods? (Choose four.)

  1. doGet()

  2. doPost()

  3. doConnect()

  4. doOptions()

  5. doHead()

  6. doRequest()


Correct Option: A,B,D,F

Which statements are true about comparing two instances of the same class, given that the equals() and hashCode() methods have been properly overridden? (Choose all that apply.)

  1. If the equals() method returns true, the hashCode() comparison == might return false

  2. If the equals() method returns false, the hashCode() comparison == might return true

  3. If the hashCode() comparison == returns true, the equals() method must return true

  4. If the hashCode() comparison == returns true, the equals() method might return true

  5. If the hashCode() comparison != returns true, the equals() method might return true


Correct Option: B,D

Given: import java.util.*; class MapEQ { public static void main(String[] args) { Map m = new HashMap(); ToDos t1 = new ToDos("Monday"); ToDos t2 = new ToDos("Monday"); ToDos t3 = new ToDos("Tuesday"); m.put(t1, "doLaundry"); m.put(t2, "payBills"); m.put(t3, "cleanAttic"); System.out.println(m.size()); } } class ToDos{ String day; ToDos(String d) { day = d; } public boolean equals(Object o) { return ((ToDos)o).day == this.day; } // public int hashCode() { return 9; } } Which is correct? (Choose all that apply.)

  1. As the code stands it will not compile

  2. As the code stands the output will be 2

  3. As the code stands the output will be 3

  4. If the hashCode() method is uncommented the output will be 2

  5. If the hashCode() method is uncommented the output will be 3

  6. If the hashCode() method is uncommented the code will not compile


Correct Option: C,D

Given: 12. public class AccountManager { 13. private Map accountTotals = new HashMap(); 14. private int retirementFund; 15. 16. public int getBalance(String accountName) { 17. Integer total = (Integer) accountTotals.get(accountName); 18. if (total == null) 19. total = Integer.valueOf(0); 20. return total.intValue(); 21. } 23. public void setBalance(String accountName, int amount) { 24. accountTotals.put(accountName, Integer.valueOf(amount)); 25. } 26. } This class is to be updated to make use of appropriate generic types, with no changes in behavior (for better or worse). Which of these steps could be performed? (Choose three.)

  1. Replace line 13 with private Map accountTotals = new HashMap();

  2. Replace line 13 with private Map accountTotals = new HashMap();

  3. Replace line 13 with private Map> accountTotals = new HashMap>();

  4. Replace lines 17–20 with int total = accountTotals.get(accountName); if (total == null) total = 0; return total;

  5. Replace lines 17–20 with Integer total = accountTotals.get(accountName); if (total == null) total = 0; return total;

  6. Replace line 24 with accountTotals.put(accountName, amount);


Correct Option: B,E,F
  1. ArrayList input = null; ArrayList output = null;

  2. ArrayList input = null; List output = null;

  3. ArrayList input = null; List output = null;

  4. List input = null; ArrayList output = null;

  5. List input = null; List output = null;

  6. List input = null; List output = null;


Correct Option: B,E,F
  1. declarations

  2. scriptlets

  3. expressions

  4. All of the above


Correct Option: D
  1. Both a and b

  2. None of the above


Correct Option: C
- Hide questions