单选题以下哪种初始化数组的方式是错误的?()A String[] name =,“zhang”,”wang”,”li”-B String*3+ names=,“zhang”,”wang”,”li”-C String names[] =new String[3]  names*0+=”wang”D names*1+=”wang”E names*2+=”li”F 以上皆正确

题目
单选题
以下哪种初始化数组的方式是错误的?()
A

String[] name =,“zhang”,”wang”,”li”-

B

String*3+ names=,“zhang”,”wang”,”li”-

C

String names[] =new String[3]  names*0+=”wang”

D

names*1+=”wang”

E

names*2+=”li”

F

以上皆正确


相似考题

1.DAnne and Joseph are talking about an interesting question. Why do some people change their names? There can be many reasons. Hanna changed her name to Anne because she thought it would be easier for people to remember. On the other hand, Joseph is thinking about changing his name to an unusual name because he wants to be different.People have a lot of reasons for changing their names. Film stars, singers, sportsmen and some other famous people often change their names because they want names that are not ordinary, or that have special sound. They chose the “new name” for themselves instead of the name their parents gave them when they were born.Some people have another reason for changing their names. They have moved to a new country and want to use a name that is usual there. For example, Li Kaiming changed his name to Ken Lee when he moved to the United States. He uses the name Ken at his job and at school. But with his family and Chinese friends, he uses Li Kaiming. For some people, using different names makes life easier in their new country.In many countries, a woman changes her family name to her husband’s after she gets married. But today, many women are keeping their own family name and not using their husband’s. Sometimes , women use their own name in some situations (情况)and their husband’s in other situations . And some use both their own name and their husband’s.根据短文内容,完成下面表格。different peoplereason to change the nameHannaIt is ____61____ for people to remember.JosephHe wants to have a name that’s ____62_____.famous peopleTheir name may sound _____63_____.Li KaimingUsing different names can make ____64_____ easier.a womanAfter she gets _____65_____, she may change her name.61._________________________________________________________________________

更多“单选题以下哪种初始化数组的方式是错误的?()A String[] name =,“zhang”,”wang”,”li”-B String*3+ names=,“zhang”,”wang”,”li”-C String names[] =new String[3]  names*0+=”wang”D names*1+=”wang”E names*2+=”li”F 以上皆正确”相关问题
  • 第1题:

    It's very interesting to study names of different countries.Chinese names are different (1) foreign names.Once an English lady came to visit me.When I was introduced to her she said, “ Glad to meet you, Miss Ping.” Then she gave me her name card with three words on it:"Betty J.Black.So I said, “Thank you, Miss Betty.” We looked at each other and laughed heartily.Later I found that the English people (2)their family names last and the given names first, while their middle names are not used very much.I explained to her that the Chinese family name comes first, the given name last, so she(3) never call me Miss Ping.She asked if we Chinese had a middle name.I told her we didn't.but people may often find three words

    on a Chinese name card.In this case the family name still come first, and the other words after it(4)a two-word given name.it is quite usual in China.My sister is Li Xiaofang.She has two words in her given name instead (5) just one like mine.(完型填空)

    A.Put

    B.From

    C.Should

    D.of

    E.are


    答案:B A C E D 

    解析:本段意思:研究不同国家的名称是非常有趣的。中国人的名字不同于外国人的名字。有一次,一位英国女士来看我。当我被介绍给她时,她说:“很高兴认识你,萍小姐。然后她给了我她的名片,上面有三个字:“贝蒂·j·布莱克。”所以我说:“谢谢你,贝蒂小姐。我们面面相觑,开怀大笑。后来我发现英国人把姓放在最后,名放在前面,中间的名字用得不多。我向她解释中国姓在前,名在后,所以她永远不要叫我萍小姐。她问我们中国人有没有中间名。我告诉她我们没有。但是人们经常会在一张中文名片上发现三个字。在这种情况下,姓仍然在前面,在它后面的其他单词是两个单词组成的名字。这在中国很常见。我妹妹是李小芳。她有两个字在她的名字,而不像我一样只有一个。


  • 第2题:

    String s="zhang san,li si,wang wu"; 按字母顺序对姓名


    正确答案:
      

  • 第3题:

    定义结构体数组: struct stu { int num; char nameE20]; }X[5]={1,"LI",2,"ZHAO",3,"WANG",4," ZHANG",5,"LIU"); for(i=1;i<5;i++) printf("%d%c",x[i].num,x[i].name[2]); 以上程序段的输出结果为( )。

    A.2A3N4A5U

    B.112A3H4I

    C.1A2N3A4U

    D.2H3A4H5I


    正确答案:A
    本题主要考查结构体数组的使用。x[i].num为结构体x[i]中的hum成员,x[i].num[2]是结构体x[i]中name成员的第3个元素。程序执行循环过程时:第1次循环,i=1,输出x[i].num,x[1].name[2]的值;第2次循环,i=2,输出x[2].num,x[2].name[2]的值,即3N;第3次循环,i=3,输出X[3].hum,x[3].name[2]的值,即4A;第4次循环,i=4,输出x[4].num,x[4].name[2]的值,即5U。

  • 第4题:

    阅读以下说明和 Java程序,填补代码中的空缺,将解答填入答题纸的对应栏内。 【说明】 以下Java代码实现一个简单客户关系管理系统(CRM)中通过工厂(CustomerFactory )对象来创建客户(Customer)对象的功能。客户分为创建成功的客户(RealCustomer)和空客户 (NullCustomer)。空客户对象是当不满足特定条件时创建或获取的对象。类间关系如图 5-1 所示。图5-1 类图

    【Java代码】 Abstract class Customer﹛ Protected String name; ( 1 )boolean isNil(); ( 2 )String getName(); ﹜ Class RealCustomer ( 3 )Customer{ Public RealCustomer(String name){ this.name=name; } Public String getName(){ return name ; } Public boolean is Nil() { return false; } ﹜ Class NullCustomer( 4 )Customer﹛ Public String getName()﹛ return "Not Available in Customer Database"; ﹜ Public boolean isNil() ﹛ return true; ﹜ ﹜ class Customerfactory { public String[] names = {"Rob","Joe","Julie"}; public Customer getCustomer(String name) { for (int i = 0; i < names.length;i++) { if (names[i].( 5 ))﹛ return new RealCustomer(name); ﹜ ﹜ return ( 6 ); ﹜ ﹜ Public class CrM﹛ Public viod get Customer()﹛ Customerfactory( 7 ); Customer customer1-cf.getCustomer("Rob"); Customer customer2=cf.getCustomer("Bob"); Customer customer3= cf.getCustomer("Julie"); Customer customer4= cf.getCustomer("Laura"); System.out.println("customers”) System.out.println(customer1.getName()); System.out.println(customer2getName()); System.out.println(customer3.getName()); System.out.println(customer4.getName()); ﹜ Public static viod main (String[]arge)﹛ CRM crm =new CRM(); Crm.getCustomer(); ﹜ ﹜ /*程序输出为: Customers rob Not Available in Customer Database Julie Not Available in Customer Database */


    正确答案:1)public abstract
    2) public abstract
    3)extends
    4)extends
    5)equals(name)
    6)new Null Customer()
    7) cf=New CustomerFactory();

  • 第5题:

    以下正确的电子邮箱地址的格式是

    A.wang.163.com

    B.wang@163.com

    C.wang#163.com

    D.www.wang.163.com


    正确答案:B
    解析:电子邮件地址的格式为:用户名@主机域名。主机域名采用层次结构,每层构成一个子域名,子域名之间用圆点分隔,自左至右依次为:计算机名、机构名、网络名、最高域名。

  • 第6题:

    Wang Li is()a new marketing campaign at the moment.

    Aplan

    Bplaning

    Cplanning


    C

  • 第7题:

    下面关于数组声明和初始化的语句哪个有语法错误()

    • A、int a1[]={3,4,5};
    • B、String a2[]={"string1","string1","string1"};
    • C、String a3[]=new String(3);
    • D、int[][] a4=new int[3][3];

    正确答案:C

  • 第8题:

    以下哪种初始化数组的方式是错误的?() 

    • A、 String[]names={"zhang",   "wang",   "li");
    • B、 String  names[]  =new  String [3];names [0]  ="zhang";  names [1]  ="wang";   names [2]  ="li";
    • C、 String[3] names={"zhang", "wang", "li"};
    • D、 以上皆正确

    正确答案:C

  • 第9题:

    以下哪种初始化数组的方式是错误的?()  

    • A、String[] name =,“zhang”,”wang”,”li”-
    • B、String*3+ names=,“zhang”,”wang”,”li”-
    • C、String names[] =new String[3]  names*0+=”wang”
    • D、names*1+=”wang”
    • E、names*2+=”li”
    • F、以上皆正确

    正确答案:B

  • 第10题:

    单选题
    以下哪种初始化数组的方式是错误的?()
    A

     String[]names={zhang,   wang,   li);

    B

     String  names[]  =new  String [3];names [0]  =zhang;  names [1]  =wang;   names [2]  =li;

    C

     String[3] names={zhang, wang, li};

    D

     以上皆正确


    正确答案: D
    解析: 暂无解析

  • 第11题:

    多选题
    import java.util.*;  public class NameList {  private List names = new ArrayList();  public synchronized void add(String name) { names.add(name); }  public synchronized void printAll() {  for (int i = 0; i System.out.print(names.get(i) +“ “); }  }  public static void main(String[] args) {  final NameList sl = new NameList();  for(int i=0;i
    A

    An exception may be thrown at runtime.

    B

    The code may run with no output, without exiting.

    C

    The code may rum with output “A B A B C C “, then exit.

    D

    The code may ruin with output “A A A B C A B C C “, then exit.

    E

    The code may rum with output “A B C A B C A B C “, then exit.

    F

    The code may ruin with output “A B C A A B C A B C “, then exit.


    正确答案: D,E
    解析: 暂无解析

  • 第12题:

    多选题
    Which of the following statements are true when creating NETBIOS names? ()
    A

    NETBIOS names can only use alphanumeric characters.

    B

    You can use a ’.’ in a NETBIOS name.

    C

    You can use an ’_’ (underscore) in a NETBIOS name.

    D

    NETBIOS names must be UPPERCASE

    E

    NETBIOS names can be a maximum of 32 characters


    正确答案: D,A
    解析: 暂无解析

  • 第13题:

    importjava.util.*;

    publicclassNameList{

    privateListnames=newArrayList();

    publicsynchronizedvoidadd(Stringname){names.add(name);}

    publicsynchronizedvoidprintAll(){

    for(inti=0;iSystem.out.print(names.get(i)+);

    }

    }

    publicstaticvoidmain(String[]args){

    finalNameListsl=newNameList();

    for(inti=0;i<2;i++){

    newThread(){

    publicvoidruin(){

    sl.add(”A”);

    sl.add(”B”);

    sl.add(”C”);

    sl.printAll();

    }

    }.start();

    }

    }

    }

    Whichtwostatementsaretrueifthisclassiscompiledandrun?()


    参考答案:E, F

  • 第14题:

    定义结构体数组: struct stu { int num; char name[20]; }x[5]={1,"LI",2,"ZHAO",3"WANG",4,"ZHANG",5"LIU"}; for(i=1;i<5;i++) printf("%d %c", x[i].num, x[i].name[2]); 以上程序段的输出结果为( ).

    A.2A3N4A5U

    B.1I2a3h4I

    C.1A2N3A4U

    D.2H3A4H5I


    正确答案:A
    解析:本题主要考查结构体数组的使用。x[i].mum为结构体x[i]中的num成员,x[i].name[2]是结构体x[i]中name成员的第3个元素。程序执行循环过程时:第1次循环,i=1,输出x[1].num,x[1].name[2]的值,即2A:第2次循环,i=2,输出x[2].mum,x[2].name[2]的值,即3N;第3次循环,i=3,输出x[3].num,x[3].name[2]的值,即4A;第4次循环,i=4,输出x[4].num,x[4].name[2]的值,即5U。

  • 第15题:

    include<iostream>

    include<string>

    using namespace std;

    class MyClass

    {

    public:

    MyClass(int i=0){member=i;}

    void SetMember(const string m){member="big"+m;m=member;}

    string GetMember(){return member;}

    void print()const{cout<<"Stu:"<<member<<endl;}

    private:

    string member;

    };

    void main()

    {

    MyClass obj1,*obj2;

    string i="wang lin";

    obj2=&obj1;

    obj2->SetMember(i);

    obj1.print();

    }


    正确答案:
    voidSetMember(conststringm){member=”big”+m;m=member;}。const修饰符的形参不能改变。应删去const或者删去m=member。

  • 第16题:

    阅读下列说明和C++代码,填补代码中的空缺,将解答填入答题纸的对应栏内。 【说明】 ‘ 以下C++代码实现一个简单的聊天室系统(ChatRoomSystem),多个用户(User)可以向聊天室(ChatRoom)发送消息,聊天室将消息展示给所有用户。类图如图6-1所表示。图6-1 类图

    【C++代码】 include<iostream> include <string> using namespace std; class User { private: string name; public: User(string name){ (1) =name; } ~User(){} void setName(string name) { this->name=name; } string getName(){ return name; } void sendMessage(string message); }; class ChatRoom { . public: static void showMessage(User* user, string message) { cout<<"["<<user->getName()<<"] : "<<message<<endl; } }; void User::sendMessage(string message) { (2) (this,message); } class ChatRoomSystem{ public: . . void startup() { User* zhang = new User(“John"); User* li = new User("Leo"); zhang->sendMessage("Hi! Leo!"); li_>sendMessage("Hi! John!"); } void join(User* user) { (3) ("HeIIo Everyone! l am"+user->getName()); } . }; int main(){ ChatRoomSystem*crs= (4) ; crs->startup(); crs->join( (5) ("Wayne")); delete crs; } /* 程序运行结果: [John]:Hi! Leo! [Leo]:Hi! John! [Wayne]:Hello Everyone! I am Wayne /*


    正确答案:1、this->name
    2、ChatRoom::showMessage
    3、user->sendMessage
    4、new ChatRoomSystem()
    5、new User

  • 第17题:

    试题五(共 15 分)阅读以下说明和 Java 程序,填补代码中的空缺,将解答填入答题纸的对应 栏内。【说明】以下 Java 代码实现一个简单的聊天室系统(ChatRoomSystem),多个用 户(User)可以向聊天室( ChatRoom)发送消息,聊天室将消息展示给所有用户。 类图如图 5-1 所示。

    【Java 代码】 class ChatRoom {
    public static void showMessage(User user, Strmg message) {System.out.println("[" + user.getName() + "] : " + message);} }classUser{private String name; public String getName() { return name;}public void setName(String name) { this.name = name;}public User(String name) { (1) =name;}public void sendMessage(String message) { (2) (this, message);}}public class Chat:RoomSystem { public void startup() {
    User zhang= new User("John");User li =new User("Leo"); zhang.sendMessage("Hi! Leo! "); 1i.sendMessage("Hi! John!"); } public void join(User user) { (3) ("Hello Everyone! I am" + user.getName()); }public static void main(String[] args) { ChatRoomSystem crs= (4) ; Crs.startup();Crs.join( (5) )(“Wayne”));}}/*程序运行结果: [John]:Hi! Leol [Leo]:Hi! John![Wayne】:Hello Everyone!Iam Wayne*/


    答案:
    解析:
    1、this.name
    2、ChatRoom.showMessage
    3、user.sendMessage
    4、new ChatRoomSystem()
    5、new User

  • 第18题:

    Wang Li is()a new marketing campaign at the moment.

    • A、plan
    • B、planing
    • C、planning

    正确答案:C

  • 第19题:

    Which of the following statements are true when creating NETBIOS names? ()

    • A、 NETBIOS names can only use alphanumeric characters.
    • B、 You can use a ’.’ in a NETBIOS name.
    • C、 You can use an ’_’ (underscore) in a NETBIOS name.
    • D、 NETBIOS names must be UPPERCASE
    • E、 NETBIOS names can be a maximum of 32 characters

    正确答案:B,C

  • 第20题:

    import java.util.*;  public class NameList {  private List names = new ArrayList();  public synchronized void add(String name) { names.add(name); }  public synchronized void printAll() {  for (int i = 0; i System.out.print(names.get(i) +“ “); }  }  public static void main(String[] args) {  final NameList sl = new NameList();  for(int i=0;i<2;i++) {  new Thread() {  public void ruin() {  sl.add(”A”);  sl.add(”B”);  sl.add(”C”);  sl.printAll();  }  }.start();  }  }  }  Which two statements are true if this class is compiled and run?()

    • A、 An exception may be thrown at runtime.
    • B、 The code may run with no output, without exiting.
    • C、The code may rum with output “A B A B C C “, then exit.
    • D、The code may ruin with output “A A A B C A B C C “, then exit.
    • E、 The code may rum with output “A B C A B C A B C “, then exit.
    • F、The code may ruin with output “A B C A A B C A B C “, then exit.

    正确答案:E,F

  • 第21题:

    单选题
    以下哪种初始化数组的方式是错误的?()
    A

    String[] name =,“zhang”,”wang”,”li”-

    B

    String*3+ names=,“zhang”,”wang”,”li”-

    C

    String names[] =new String[3]  names*0+=”wang”

    D

    names*1+=”wang”

    E

    names*2+=”li”

    F

    以上皆正确


    正确答案: A
    解析: 暂无解析

  • 第22题:

    单选题
    Wang Li is()a new marketing campaign at the moment.
    A

    plan

    B

    planing

    C

    planning


    正确答案: C
    解析: 暂无解析

  • 第23题:

    单选题
    有如下程序:#include struct person{ char name[10]; int age;};main(){ struct person room[4] = {{Zhang,19}, {Li,20}, {Wang,17}, {Zhao,18}}; printf(%s:%d,(room+2)->name, room->age);}程序运行后的输出结果是(  )。
    A

    Wang:19

    B

    Wang:17

    C

    Li:20

    D

    Li:19


    正确答案: B
    解析:
    可用以下3种形式来引用结构体变量中的成员:①结构体变量名.成员名;②指针变量名->成员名;③(*指针变量名).成员名。数组名room是指向数组首地址,也可以当做指向数组的指针来使用。room+2指向数组第三个元素,(room+2)->name为字符串Wang;room指向数组第一个元素,room->age=19。答案选择A选项。

  • 第24题:

    单选题
    关于查询中列的别名, 以下()语句是不正确的
    A

    Select name as’姓名’from table

    B

    Select name as姓名from table where id=1

    C

    Sleect name=姓名from table姓名=names(正确答案)

    D

    Select names姓名from table


    正确答案: C
    解析: 暂无解析