• 2022-06-09 问题

    在对象的方法中访问属性name的语法为()。 A: self.name B: this.name C: self.name() D: this.name()

    在对象的方法中访问属性name的语法为()。 A: self.name B: this.name C: self.name() D: this.name()

  • 2022-05-28 问题

    声明一个对象,给它加上name属性和show方法显示其name值,以下代码中正确的是() A: varobj=[name:"zhangsan",show:function(){alert(name);}]; B: varobj=,name:"zhangsan",show:”alert(this.name)”-; C: varobj={name:"zhangsan",show:function(){alert(name);}}; D: varobj={name:"zhangsan",show:function(){alert(this.name);}};

    声明一个对象,给它加上name属性和show方法显示其name值,以下代码中正确的是() A: varobj=[name:"zhangsan",show:function(){alert(name);}]; B: varobj=,name:"zhangsan",show:”alert(this.name)”-; C: varobj={name:"zhangsan",show:function(){alert(name);}}; D: varobj={name:"zhangsan",show:function(){alert(this.name);}};

  • 2022-06-11 问题

    访问如下json对象中的name属性的方式是:var stu={name:"张三",age:20} A: stu[name] B: stu.name C: stu->name D: this.name

    访问如下json对象中的name属性的方式是:var stu={name:"张三",age:20} A: stu[name] B: stu.name C: stu->name D: this.name

  • 2021-04-14 问题

    (6-9)定义了如下Person类,下面程序段能够正确初始化Person数组。 class Person{ private String name; public Person(String name){ this.name=name; } }

    (6-9)定义了如下Person类,下面程序段能够正确初始化Person数组。 class Person{ private String name; public Person(String name){ this.name=name; } }

  • 2021-04-14 问题

    下列程序的运行结果是( )class Demo{private String name;Demo(String name){this.name = name;}private static void show(){System.out.println(name)}public static void main(String[] args){Demo d = new Demo(“lisa”);d.show();}}

    下列程序的运行结果是( )class Demo{private String name;Demo(String name){this.name = name;}private static void show(){System.out.println(name)}public static void main(String[] args){Demo d = new Demo(“lisa”);d.show();}}

  • 2021-04-14 问题

    分析如下所示的Java代码,其中this关键字的意思是( )。 public class Test { private String name; public String getName() { return name; } public void setName(String name) { this.name = name; //this关键字所在的行 } }

    分析如下所示的Java代码,其中this关键字的意思是( )。 public class Test { private String name; public String getName() { return name; } public void setName(String name) { this.name = name; //this关键字所在的行 } }

  • 2022-06-01 问题

    有如下类的定义,创建Employee对象错误的是() public class Employee{ private int age; private String name; public Employee(int age){ this.age = age; } public Employee(String name){ this.name = name; } public Employee(int age,String name){ this(age); this.name = name; } } A: Employee emp = new Employee(10); B: Employee emp = new Employee("Tom"); C: Employee emp = new Employee(); D: Employee emp = new Employee(10,"Tom");

    有如下类的定义,创建Employee对象错误的是() public class Employee{ private int age; private String name; public Employee(int age){ this.age = age; } public Employee(String name){ this.name = name; } public Employee(int age,String name){ this(age); this.name = name; } } A: Employee emp = new Employee(10); B: Employee emp = new Employee("Tom"); C: Employee emp = new Employee(); D: Employee emp = new Employee(10,"Tom");

  • 2022-07-24 问题

    以下能够创建一个对象的是( )。 A: var obj=new Object( ) ; B: var obj=function(name){this.name=name ; }<br> var p1=new obj( "张三" ) ; C: var obj={ name : "张三" ; } D: var obj=Object.create( { name: "张三" } ) ;

    以下能够创建一个对象的是( )。 A: var obj=new Object( ) ; B: var obj=function(name){this.name=name ; }<br> var p1=new obj( "张三" ) ; C: var obj={ name : "张三" ; } D: var obj=Object.create( { name: "张三" } ) ;

  • 2021-04-14 问题

    设有下面的类的定义: class AA{ String name; public AA(){ System.out.print("我是AA!"); } public AA(String name){ this.name=name; System.out.print("我的名字是"+name);} } 则执行 AA a=new AA(“张三”); AA b=new AA(); 输出的是:

    设有下面的类的定义: class AA{ String name; public AA(){ System.out.print("我是AA!"); } public AA(String name){ this.name=name; System.out.print("我的名字是"+name);} } 则执行 AA a=new AA(“张三”); AA b=new AA(); 输出的是:

  • 2022-05-26 问题

    在javascript中,执行后输出的结果是: var name="zhaonan"; var obj1={ name:"miao", age:20, say:function(){ console.log(this.name); } } var obj2={ name:"xue", age:30, say:function(){ console.log(this.name); } } var f=obj2.say; console.log(f()); var e=f.bind(obj1); console.log(e()); var k=e.bind(obj2); console.log(k()); A: zhaonan zhaonan miao B: zhaonan miao miao C: zhaonan miao xue D: miao zhaonan xue

    在javascript中,执行后输出的结果是: var name="zhaonan"; var obj1={ name:"miao", age:20, say:function(){ console.log(this.name); } } var obj2={ name:"xue", age:30, say:function(){ console.log(this.name); } } var f=obj2.say; console.log(f()); var e=f.bind(obj1); console.log(e()); var k=e.bind(obj2); console.log(k()); A: zhaonan zhaonan miao B: zhaonan miao miao C: zhaonan miao xue D: miao zhaonan xue

  • 1 2 3 4 5 6 7 8 9 10