以下代码执行后的结果是: public class Person { String name = “小芳”; public Person(String name) { name = “小兰”; } public void show() { this.name = “小翠”; } public static void main(String[] args) { Person p = new Person(“小凤”); System.out.print(p.name); p.show(); System.out.print(p.name); } }
以下代码执行后的结果是: public class Person { String name = “小芳”; public Person(String name) { name = “小兰”; } public void show() { this.name = “小翠”; } public static void main(String[] args) { Person p = new Person(“小凤”); System.out.print(p.name); p.show(); System.out.print(p.name); } }
能将字符串存储到name数组中的选项有() A: char name[20], *p;p=name;gets(name); B: char name[20], *p;p=name;gets(p); C: char name[20], *p;p=name;scanf("%s",name); D: char name[20], *p;p=name;scanf("%s",p);
能将字符串存储到name数组中的选项有() A: char name[20], *p;p=name;gets(name); B: char name[20], *p;p=name;gets(p); C: char name[20], *p;p=name;scanf("%s",name); D: char name[20], *p;p=name;scanf("%s",p);
对于Person类,如果给成员变量name赋值 A: Person.name="老王"; B: p.name="老王"; C: p.setName("老王"); D: p.getName("老王");
对于Person类,如果给成员变量name赋值 A: Person.name="老王"; B: p.name="老王"; C: p.setName("老王"); D: p.getName("老王");
以下程序有三处语法错误,请指出#include<;stdio.h>;struct student{short num;char name[20];char sex;short age;}int main(){struct student stu[4] = {{112,"Wang Lin",'M',15},{113,"Li",'W',20}};struct student *p;stu[2].num = stu[1].num+1;stu[2].name = stu[1].name;stu[2].sex = 'W';stu[2].age = 23;printf("%s\n",stu[2].name);p = &stu[3];*p = stu[0];printf("%s",p.name);return 0;}
以下程序有三处语法错误,请指出#include<;stdio.h>;struct student{short num;char name[20];char sex;short age;}int main(){struct student stu[4] = {{112,"Wang Lin",'M',15},{113,"Li",'W',20}};struct student *p;stu[2].num = stu[1].num+1;stu[2].name = stu[1].name;stu[2].sex = 'W';stu[2].age = 23;printf("%s\n",stu[2].name);p = &stu[3];*p = stu[0];printf("%s",p.name);return 0;}
下列语句错误的是()。 A: char*p=“John”;p[2]=‘a’; B: charname[5]=“John”;name[2]=’a’; C: charname[5]=“John”,*p=name;p[2]=‘a’; D: charname[5]=“John”,*p=&name[1];p[2]=‘a’;
下列语句错误的是()。 A: char*p=“John”;p[2]=‘a’; B: charname[5]=“John”;name[2]=’a’; C: charname[5]=“John”,*p=name;p[2]=‘a’; D: charname[5]=“John”,*p=&name[1];p[2]=‘a’;
When ( ) the phone, state your name and place of business. </p></p>
When ( ) the phone, state your name and place of business. </p></p>
以下属于属性选择器的是()。 A: $("input:name==a") B: $("div[name=’a1’]") C: $("span[name!=’a1’]") D: $("p[name^=’a1’]")
以下属于属性选择器的是()。 A: $("input:name==a") B: $("div[name=’a1’]") C: $("span[name!=’a1’]") D: $("p[name^=’a1’]")
style="padding-left:0px;">class Student:<p style="padding-left:50px;"> name="xxx"<p style="padding-left:50px;"> def show(cls):<p style="padding-left:100px;"> name="yyy"<p style="padding-left:100px;"> print(name,cls.name)<p style="padding-left:0px;">s=Student()<p style="padding-left:0px;">s.show()<p style="padding-left:0px;">结果
style="padding-left:0px;">class Student:<p style="padding-left:50px;"> name="xxx"<p style="padding-left:50px;"> def show(cls):<p style="padding-left:100px;"> name="yyy"<p style="padding-left:100px;"> print(name,cls.name)<p style="padding-left:0px;">s=Student()<p style="padding-left:0px;">s.show()<p style="padding-left:0px;">结果
下列定义中,属于指针数组的是( )? A: char *name[]={"abc","de"}; B: char (*p)[]; C: int (*p)[]; D: int (*name)[];
下列定义中,属于指针数组的是( )? A: char *name[]={"abc","de"}; B: char (*p)[]; C: int (*p)[]; D: int (*name)[];
阅读下面代码: Person 类: public class Person { private String name; public String getName() { return name; } public void setName(String name) { this.name = name; } } Servlet1: request.getSession().setAttribute("name","zhangsan"); Person p = new Person(); p.setName("lisi"); request.getSession().setAttribute("person",p); Servlet2: String name1 = (String)request.getSession().getAttribute("name"); Person p = (Person)request.getSession().getAttribute("person"); response.getWriter().write(name1); if(p!=null)response.getWriter().write(p.getName()); 浏览器先访问Servlet1,再去访问Servlet2,输出的结果是:()
阅读下面代码: Person 类: public class Person { private String name; public String getName() { return name; } public void setName(String name) { this.name = name; } } Servlet1: request.getSession().setAttribute("name","zhangsan"); Person p = new Person(); p.setName("lisi"); request.getSession().setAttribute("person",p); Servlet2: String name1 = (String)request.getSession().getAttribute("name"); Person p = (Person)request.getSession().getAttribute("person"); response.getWriter().write(name1); if(p!=null)response.getWriter().write(p.getName()); 浏览器先访问Servlet1,再去访问Servlet2,输出的结果是:()