• 2022-06-06
    以下代码在页面上会输出多少行数据()$attr = array(1,2,3,4); while(list($key, $value) = each($attr)) { echo $key."=>".$value.""; }while(list($key,$value) = each($attr)) { echo $key."=>".$value.""; }
    A: 8
    B: 6
    C: 12
    D: 4
  • D

    内容

    • 0

      How many key comparisons are needed in searching for key value 38() A: 1 B: 2 C: 3 D: 4

    • 1

      以下哪遍历字典、依次输出所有键值对里的值的方式是不对的: A: for key in dict: print(dict[key]) B: for key in dict.keys(): print(dict[key]) C: for key,value in dict.items(): print(value) D: for value in dict: print(value)

    • 2

      中国大学MOOC: 以下Pair泛型类public class Pair<K, V> { public Pair(K key, V value) { this.key = key; this.value = value; } public K getKey(); { return key; } public V getValue(); { return value; } public void setKey(K key) { this.key = key; } public void setValue(V value) { this.value = value; } private K key; private V value;}经过类型擦除后,变成以下类public class Pair { public Pair(Object key, Object value) { this.key = key; this.value = value; } public Object getKey() { return key; } public Object getValue() { return value; } public void setKey(Object key) { this.key = key; } public void setValue(Object value) { this.value = value; } private Object key; private Object value;}

    • 3

      ()可以匹配所有attr属性包含了字符串“value”的E元素 A: E[attr]选择器 B: E[attr^="value"]的选择器 C: E[attr*="value"]的选择器 D: E[attr="value"]的选择器

    • 4

      HashMap中的put()方法参数是() A: put(value,key) B: put(key,key) C: put(key,value) D: put(key,key)