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

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

创建一个对象obj,该对象包含一个名为"name"的属性,其值为"value"。以下哪一段JavaScript代码无法得到上述的结果?()

  • A、var obj=new Object();obj["name"]="value";
  • B、var obj=new Object();obj.prototype.name="value";
  • C、var obj={name:"value"};
  • D、var obj=new function(){this.name="value";}

参考答案

更多 “创建一个对象obj,该对象包含一个名为"name"的属性,其值为"value"。以下哪一段JavaScript代码无法得到上述的结果?()A、varobj=new Object();obj["name"]="value";B、var obj=new Object();obj.prototype.name="value";C、var obj={name:"value"};D、var obj=new function(){this.name="value";}” 相关考题
考题 请使用VC6或使用【答题】菜单打开考生文件夹projl下的工程projl,该工程含有一个源程序文件pn,jl.cpp。其中位于每个注释“//ERROR 木}}水found}}水木”之后的一行语句存在错误。请改正这些错误,使程序的输出结果为: The value is 10 注意:只修改注释“//ERROR **** found****”的下一行语句,不要改动程序中的其他内容。 //pmjl.cpp includeiostream using namespace std; class MyClass{ int value; public: //ERROR********found********* void MyClass(int val):value(val){} int GetValueconst{return value;} void SetValue(int val); }; //ERROR********found******** inline void SetValue(int val){value=val;} int main MyClass obj(O); obj.SetValue(10); //ERROR********found********下列语句功能是输出obj的成员value的值 tout”The value is”obj.valueendl: return 0; }

考题 把一个对象写到一个流中相对比较简单,具体是通过调用ObjectOutputStream类的writeObject()方法实现的,那么该方法的定义为( )。A.public final int writeObject(Object obj) throws IOExceptionB.public final void writeObject(Object obj) throws IOExceptionC.public Object writeObject(Object obj) throws IOExceptionD.public final Object writeObject(Object obj) throws IOException

考题 下列程序在Frame中设定BorderLayout布局管理器,选择正确的语句填入程序的横线处。 import java.awt.*; public class ex43 extends Frame { public static void main(String[] args) { ex43 bj = new ex43("BorderLayout"); ______ obj.add("North", new Button("North")); obj.add("South", new Button("Sourth")); obj.add("East", new Button ("East")); obj.add("West", new Button ("West")); obj. add ("Center", new Button ( "Center" ) ); obj.pack(); obj. setVisible (true); } public ex43(String str) { super (str); } }A.obj.setLayout(new BorderLayout());B.setLayout(new Borderkayout());C.setLayout(BorderLayout());D.obj.setLayout(BorderLayout());

考题 有如下程序; public class MethTest { static int Varl=100; int Var2=200; public static void main(String args[]) { Varl=10; MethTest Obj1=new MethTest(); MethTest Obj2=new MethTest(); Obj1.Varl++; System.out.println(Objl.Varl); Obj2.Varl++; System.out.println(Obj2.Varl); MethTest.Varl++; System.out.println(Objl.Varl); Obj1.Var2++; System.out.println(Obj1.Var2); Obj2.Var2++; System.out.println(Obj2.Var2); } } 程序的运行结果为( )。A.11 12 13 201 201B.101 102 103 201 201C.11 12 13 201 202D.10 10 10 201 201

考题 以下程序的执行结果为()。includeclass myClass{Dublic:myClass(intdata) ;myClass( 以下程序的执行结果为( )。 #include<iostream.h> class myClass { Dublic: myClass(int data) ; myClass(){value=0; }; myClass(myClass obj); void print(){ cout<<value<<end1; } ~myClass(){} private: int value; }; myClass::myClass(int data) {value=data; } myClass::myClass(myClass Obj) { value=obj.value; } void main() { myClass a(100); myClass b(a) ; b.print(); }A.0B.100C.10D.程序编译时出错

考题 设有如下代码:interface IFace{}class CFace implements IFace{}class Base{}public class ObRef extends Base{public static void main(String argv[]){ObRef bj = new ObRef();Base b = new Base();Object obj1 = new Object();IFace obj2 = new CFace();//Here}}则在 //Here处插入哪个代码将不出现编译和运行错误。A.obj1=obj2;B.b=obj;C.obj=b;D.obj1=b;

考题 在HTML页面中,定义了如下的Javascript函数,则正确调用该函数的HTML代码是()  function compute(op){  alert(op);  }A、input name=”a” type=”button” onclick=”compute(this.value)” value=”+” B、input name=”b” type=”button” onclick=”compute(‘-‘)” value=”-” C、input name=”c” type=”button” onclick=”compute(“*”)” value=”*” D、input name=”d” type=”button” onclick=”compute(/ )” value=”/”

考题 创建一个对象obj,该对象包含一个名为"name"的属性,其值为"value"。以下哪一段JavaScript代码无法得到上述的结果()A、 var obj = new Object();obj["name"] = "value";B、 var obj = new Object();obj.prototype.name = "value";C、 var obj = {name : "value"};D、 var obj = new function() {  this.name = "value";}

考题 在HTML页面中包含一个按钮控件mybutton,如果要实现点击该按钮时调用已定义的Javascript函数compute,要编写的HTML代码是()。A、〈input name=“mybutton” type=“button” onBlur=“compute()” value=“计算”〉B、〈input name=“mybutton” type=“button” onFocus=“compute()” value=“计算”〉C、〈input name=“mybutton” type=“button” onClick=“functioncompute()” value=“计算”〉D、〈input name=“mybutton” type=“button” onClick=“compute()” value=“计算”〉

考题 以下为一段浏览器中可运行的Javascript代码,则运行该段Javascript代码的页面弹出框中显示的结果是:() 1 var obj = {"key":"1","value":"2"};  2 var newObj = obj;  3 newObj.value += obj.key;  4 alert(obj.value);A、2B、12C、3D、21

考题 在HTML页面中包含一个按钮控件mybutton,如果要实现点击该按钮时调用已定义的Javascript函数compute,要编写的HTML代码是()A、input name=”mybutton” type=”button” onBlur=”compute()”value=”计算” B、input name=”mybutton” type=”button” onFocus=”compute()”value=”计算” C、input name=”mybutton” type=”button” onClick=”function compute()”value=”计算” D、input name=”mybutton” type=”button” onClick=”compute()”value=”计算”

考题 void waitForSignal() {  Object obj = new Object();  synchronized (Thread.currentThread()) {  obj.wait();  obj.notify();  }  }  Which is true?() A、 This code may throw an InterruptedException.B、 This code may throw an IllegalStateException.C、 This code may throw a TimeoutException after ten minutes.D、 This code will not compile unless “obj.wait()” is replaced with “((Thread) obj).wait()”.E、 Reversing the order of obj.wait() and obj.notify() may cause this method to complete normally.F、 A call to notify() or notifyAll() from another thread may cause this method to complete normally.

考题 表单元素重置按钮的代码为()。A、<inputtype="submit"name="..."value="...">B、<inputtype="reset"name="..."value="...">C、<inputtype="button"name="..."value="..."onClick="...">D、<inputtype="radio"name="..."value="...">

考题 以下装箱、拆箱语句中,错误的有()A、 object obj=100;  int m=(int)obj;B、 object obj=100;  int m=obj;C、 object obj=(int)100;  int m=(int)obj;D、 object obj=(object)100;  int m=(int)obj;

考题 表单元素一般按钮的代码为()。A、<inputtype="submit"name="..."value="...">B、<inputtype="reset"name="..."value="...">C、<inputtype="button"name="..."value="..."onClick="...">D、<inputtype="radio"name="..."value="...">

考题 In a JSP-centric shopping cart application, you need to move a client’s home address of the Customerobject into the shipping address of the Order object. The address data is stored in a value object classcalled Address with properties for: street address, city, province, country, and postal code. Which two JSPcode snippets can be used to accomplish this goal?()A、c:set var=’order’ property=’shipAddress’value=’${client.homeAddress}’ /B、c:set target=’${order}’ property=’shipAddress’value=’${client.homeAddress}’ /C、jsp:setProperty name=’${order}’ property=’shipAddress’ value=’${client.homeAddress}’ /D、c:set var=’order’ property=’shipAddress’jsp:getProperty name=’client’ property=’homeAddress’ / /c:storeE、c:set target=’${order}’ property=’shipAddress’jsp:getProperty name=’client’ property=’homeAddress’ / /c:set

考题 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)

考题 单选题创建一个对象obj,该对象包含一个名为"name"的属性,其值为"value"。以下哪一段JavaScript代码无法得到上述的结果?()A varobj=new Object();obj[name]=value;B var obj=new Object();obj.prototype.name=value;C var obj={name:value};D var obj=new function(){this.name=value;}

考题 多选题Assume the scoped attribute priority does NOT yet exist. Which two create and set a new request-scopedattribute priority to the value "medium"?()A${priority = ’medium’}B${requestScope[’priority’] = ’medium’}Cc:set var=priority value=medium /Dc:set var=priority scope=requestmedium/c:setEc:set var=priority value=medium scope=request /

考题 单选题以下装箱、拆箱语句中,错误的有()A  object obj=100;  int m=(int)obj;B  object obj=100;  int m=obj;C  object obj=(int)100;  int m=(int)obj;D  object obj=(object)100;  int m=(int)obj;

考题 单选题在HTML页面中包含一个按钮控件mybutton,如果要实现点击该按钮时调用已定义的Javascript函数compute,要编写的HTML代码是()。A 〈input name=“mybutton” type=“button” onBlur=“compute()” value=“计算”〉B 〈input name=“mybutton” type=“button” onFocus=“compute()” value=“计算”〉C 〈input name=“mybutton” type=“button” onClick=“functioncompute()” value=“计算”〉D 〈input name=“mybutton” type=“button” onClick=“compute()” value=“计算”〉

考题 单选题void waitForSignal() {  Object obj = new Object();  synchronized (Thread.currentThread()) {  obj.wait();  obj.notify();  }  }  Which is true?()A  This code may throw an InterruptedException.B  This code may throw an IllegalStateException.C  This code may throw a TimeoutException after ten minutes.D  This code will not compile unless “obj.wait()” is replaced with “((Thread) obj).wait()”.E  Reversing the order of obj.wait() and obj.notify() may cause this method to complete normally.F  A call to notify() or notifyAll() from another thread may cause this method to complete normally.

考题 单选题C#中的TestClass为一自定义类,其中有如下属性定义:   public void Property{……}  使用以下语句创建了该类的对象,并让变量obj引用该对象。   TestClass obj=new TestClass();  那么,可通过()方式访问类TestClass的Property属性。A  MyClass. PropertyB  obj. PropertyC  TestClass. PropertyD  obj. Property()

考题 单选题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)

考题 多选题In a JSP-centric shopping cart application, you need to move a client’s home address of the Customerobject into the shipping address of the Order object. The address data is stored in a value object classcalled Address with properties for: street address, city, province, country, and postal code. Which two JSPcode snippets can be used to accomplish this goal?()Ac:set var=’order’ property=’shipAddress’value=’${client.homeAddress}’ /Bc:set target=’${order}’ property=’shipAddress’value=’${client.homeAddress}’ /Cjsp:setProperty name=’${order}’ property=’shipAddress’ value=’${client.homeAddress}’ /Dc:set var=’order’ property=’shipAddress’jsp:getProperty name=’client’ property=’homeAddress’ / /c:storeEc:set target=’${order}’ property=’shipAddress’jsp:getProperty name=’client’ property=’homeAddress’ / /c:set

考题 单选题创建一个对象obj,该对象包含一个名为"name"的属性,其值为"value"。以下哪一段JavaScript代码无法得到上述的结果()A  var obj = new Object();obj[name] = value;B  var obj = new Object();obj.prototype.name = value;C  var obj = {name : value};D  var obj = new function() {  this.name = value;}

考题 ( 难度:中等)以下哪条语句会产生运行错误:( )A.var obj = ( );B.var obj = [ ];C.var obj = { };D.var obj = / /;