网友您好, 请在下方输入框内输入要搜索的题目:

题目内容 (请给出正确答案)

Which HttpSession method stores an object in a session?()

  • A、 put(String name. Object value)
  • B、 set(String name. Object value)
  • C、 setAttribute(String name. Object value)
  • D、 putAttribute(String name. Object value)
  • E、 addAttribute(String name. Object value)

参考答案

更多 “Which HttpSession method stores an object in a session?()A、 put(String name. Object value)B、 set(String name. Object value)C、 setAttribute(String name. Object value)D、 putAttribute(String name. Object value)E、 addAttribute(String name. Object value)” 相关考题
考题 Python中通过Key来从字典object中读取对应的Value的方法有() A.object[key]B.object.get(key)C.object.pop(key)D.object.pop()

考题 Given:What is the result?() A.Compilation fails.B.exception is thrown at runtime.C.The attribute id in the ItemTest object remains unchanged.D.The attribute id in the ItemTest object is modified to the new value.E.A new ItemTest object is created with the preferred value in the id attribute.

考题 String s = new String("xyz");创建了几个String Object?二者之间有什么区别?

考题 以下程序的运行结果为:public class My{int value;public static void main(String args[]) {My x=new My();if (x==null)System.out.println("No Object");elseSystem.out.println(x.value);}} A. 0B. 1C. No ObjectD. 编译错误E. null

考题 在下列选项中,正确创建并实现写入cookie的语句分别是()。 A、 Cookie cookie = new Cookie( String key, Object value );B、 Cookie cookie = new Cookie();C、 response.add(cookie );D、 response.addCookie(cookie);

考题 public class ItemTest {  private final mt id;  public ItemTest(int id) { this.id = id; }  public void updateId(int newId) { id = newId; }  public static void main(String[] args) {  ItemTest fa = new ItemTest(42);  fa.updateId(69);  System.out.println(fa.id);  }  }  What is the result?() A、 Compilation fails.B、 An exception is thrown at runtime.C、 The attribute id in the Item object remains unchanged.D、 The attribute id in the Item object is modified to the new value.E、 A new Item object is created with the preferred value in the id attribute.

考题 Which statements concerning the value of a member variable are true, when no explicit assignments have been made?()  A、The value of an int is undetermined.B、The value of all numeric types is zero.C、The compiler may issue an error if the variable is used before it is initialized.D、The value of a String variable is "" (empty string).E、The value of all object variables is null.

考题 public class Person {  private name;  public Person(String name) {  this.name = name;  }  public int hashCode() {  return 420;  }  }  Which is true?() A、 The time to find the value from HashMap with a Person key depends on the size of the map.B、 Deleting a Person key from a HashMap will delete all map entries for all keys of typePerson.C、 Inserting a second Person object into a HashSet will cause the first Person object to beremoved as a duplicate.D、 The time to determine whether a Person object is contained in a HashSet is constant and does NOT depend on the size of the map.

考题 Given an HttpServletRequest request: 22.String id = request.getParameter("jsessionid"); 23.// insert code here 24.String name = (String) session.getAttribute("name"); Which three can be placed at line 23 to retrieve anexisting HttpSession object?()A、HttpSession session = request.getSession();B、HttpSession session = request.getSession(id);C、HttpSession session = request.getSession(true);D、HttpSession session = request.getSession(false);E、HttpSession session = request.getSession("jsessionid");

考题 在j2ee中,以下是firevetoablechange方法的正确的原型的是() A、public void fireVetoableChange(Object  oldValue,Object newValue)B、 public void fireVetoableChange(String  propertyName,Object newValue)C、 public void fireVetoableChange(String  propertyName, Object  oldValue ,Object newValue)throws PropertyVetoExceptionD、 public void fireVetoableChange(String  propertyName, Object  oldValue ,Object newValue)

考题 String s=new String("xyz");创建了几个String Object?

考题 在J2EE中,以下是firePropertyChange的原型,正确的是()。 A、public void firePropertyChange(PropertyChangeListener l,String oldValue, String newValue)B、public void firePropertyChange(String propertyName, Object oldValue, Object newValue)C、public void firePropertyChange(PropertyChangeSupport changes)D、public void firePropertyChange(Object oldValue, Object newValue)

考题 Which methods from the String and StringBuffer classes modify the object on which they are called?()  A、The charAt() method of the String class.B、The toUpperCase() method of the String class.C、The replace() method of the String class.D、The reverse() method of the StringBuffer class.E、The length() method of the StringBuffer class.

考题 You want to use te Coherence Java APIs to directly cached POJOs. Consider this snippet of code: NamedCache cache - CacheFactory.getCache("mycache");  cache.put(new Integer(I)f "hello"); cache.put(T,"hi");  cache.put(new Long(II),"hey");  This code inserts three objects into the cache.  Why ?()A、 hashCode() and equals() method for each object type is different so a different key is usedB、 each object value string is different so a different value is inserted on each putC、 equals() and compare() method is different for each putD、 POF need to be implemented for this to work properly

考题 You are developing an application that connects to a Microsoft SQL Server database using the SqlConnection object. Your connection objects are being pooled. As the pool fills up, connection requests are queued. Some connection requests are rejected. You need to ensure that the application releases connections back to the pool as soon as possible. Also, you need to decrease the likelihood that connection requests will be rejected. Which three actions should you perform?()A、Ensure that the Close method is called on each connection object after it has finishedexecuting.B、Ensure that each connection object is left open after it has finished executing.C、Increase the Max Pool Size value inside the connection string.D、Increase the Min Pool Size value inside the connection string.E、Increase the Connection Lifetime value inside the connection string.F、Increase the value of the ConnectionTimeout property of the SqlConnection object.

考题 You work as an application developer at Certkiller .com. You are currently in the process of creating a class that stores data about Certkiller .com’s customers. Certkiller .com customers are assigned unique identifiers and various characteristics that may include aliases, shipping instructions, and sales comments. These characteristics can change in both size and data type. You start by defining the Customer class as shown below: public class Customer { private int custID; private ArrayList attributes; public int CustomerID { get {return custID;} } public Customer (int CustomerID) { this.custID = CustomerID; this.attributes = new ArrayList (); } public void AddAttribute (object att) {  attributes.Add (att); } } You have to create the FindAttribute method for locating attributes in Customer objects no matter what the data type is.You need to ensure that the FindAttributemethod returns the attribute if found,and you also need to ensure type-safety when returning the attribute.What should you do?()A、 Use the following code to declare the FindAttribute method: public T FindAttribute (T att) {//Find attribute and return the value }B、 Use the following code to declare the FindAttribute method: public object FindAttribute (object att) {//Find attribute and return the value }C、 Use the following code to declare the FindAttribute method: public T FindAttribute  (T att) {//Find attribute and return the value }D、 Use the following code to declare the FindAttribute method: public string FindAttribute (string att) {//Find attribute and return the value }

考题 多选题在下列选项中,正确创建并实现写入cookie的语句分别是()。ACookie cookie = new Cookie( String key, Object value );BCookie cookie = new Cookie();Cresponse.add(cookie );Dresponse.addCookie(cookie);

考题 多选题Which statements concerning the value of a member variable are true, when no explicit assignments have been made?()AThe value of an int is undetermined.BThe value of all numeric types is zero.CThe compiler may issue an error if the variable is used before it is initialized.DThe value of a String variable is  (empty string).EThe value of all object variables is null.

考题 单选题public class Person {  private name;  public Person(String name) {  this.name = name;  }  public int hashCode() {  return 420;  }  }  Which is true?()A  The time to find the value from HashMap with a Person key depends on the size of the map.B  Deleting a Person key from a HashMap will delete all map entries for all keys of typePerson.C  Inserting a second Person object into a HashSet will cause the first Person object to beremoved as a duplicate.D  The time to determine whether a Person object is contained in a HashSet is constant and does NOT depend on the size of the map.

考题 问答题String s = new String("xyz");创建了几个String Object?

考题 单选题Which HttpSession method stores an object in a session?()A  put(String name. Object value)B  set(String name. Object value)C  setAttribute(String name. Object value)D  putAttribute(String name. Object value)E  addAttribute(String name. Object value)

考题 多选题You are developing an application that connects to a Microsoft SQL Server database using the SqlConnection object. Your connection objects are being pooled. As the pool fills up, connection requests are queued. Some connection requests are rejected. You need to ensure that the application releases connections back to the pool as soon as possible. Also, you need to decrease the likelihood that connection requests will be rejected. Which three actions should you perform?()AEnsure that the Close method is called on each connection object after it has finished executing.BEnsure that each connection object is left open after it has finished executing.CIncrease the Max Pool Size value inside the connection string.DIncrease the Min Pool Size value inside the connection string.EIncrease the Connection Lifetime value inside the connection string.FIncrease the value of the ConnectionTimeout property of the SqlConnection object.

考题 单选题Given: What is the result?()A Compilation fails.B exception is thrown at runtime.C The attribute id in the ItemTest object remains unchanged.D The attribute id in the ItemTest object is modified to the new value.E A new ItemTest object is created with the preferred value in the id attribute.

考题 单选题在J2EE中,以下是firePropertyChange的原型,正确的是()。A public void firePropertyChange(PropertyChangeListener l,String oldValue, String newValue)B public void firePropertyChange(String propertyName, Object oldValue, Object newValue)C public void firePropertyChange(PropertyChangeSupport changes)D public void firePropertyChange(Object oldValue, Object newValue)

考题 单选题Which methods from the String and StringBuffer classes modify the object on which they are called?()A The charAt() method of the String class.B The toUpperCase() method of the String class.C The replace() method of the String class.D The reverse() method of the StringBuffer class.E The length() method of the StringBuffer class.

考题 单选题在j2ee中,以下是firevetoablechange方法的正确的原型的是()A public void fireVetoableChange(Object  oldValue,Object newValue)B  public void fireVetoableChange(String  propertyName,Object newValue)C  public void fireVetoableChange(String  propertyName, Object  oldValue ,Object newValue)throws PropertyVetoExceptionD  public void fireVetoableChange(String  propertyName, Object  oldValue ,Object newValue)

考题 单选题Which retrieves the value associated with “foo” from within an HttpServlet?()A  String value = getServletConfig( ).getParameter(“foo”);B  String value = getServletContext( ).getAttribute(“foo”);C  Object value = getServletContext( ).getInitParameter(“foo”);D  String value = getServletContext( ).getInitParameter(“foo”)