Which gets the name of the parent directory file “file.txt”?()A、 String name= File.getParentName(“file.txt”);B、 String name= (new File(“file.txt”)).getParent();C、 String name = (new File(“file.txt”)).getParentName();D、 String name= (new File(“file.txt”))

题目

Which gets the name of the parent directory file “file.txt”?()

  • A、 String name= File.getParentName(“file.txt”);
  • B、 String name= (new File(“file.txt”)).getParent();
  • C、 String name = (new File(“file.txt”)).getParentName();
  • D、 String name= (new File(“file.txt”)).getParentFile();
  • E、 Directory dir=(new File (“file.txt”)).getParentDir();  String name= dir.getName();

相似考题
更多“Which gets the n”相关问题
  • 第1题:

    以下选项中错误的是( )

    A.char *sp; gets(sp);

    B.char sp[5] gets(sp);

    C.char *sp="12345"; gets(sp);

    D.charsp[5]="\0" gets(sp)


    正确答案:A

  • 第2题:

    有以下定义:include char a[10], *b=a; 下面不能给数组a输入字符串的语句是()。A.gets(

    有以下定义: #include <stdio.h> char a[10], *b=a; 下面不能给数组a输入字符串的语句是( )。

    A.gets(a)

    B.gets(a[0]);

    C.gets(&a[0]);

    D.gets(b);


    正确答案:B
    解析:函数gets(字符数组)的功能是从终端输入一个字符串到字符数组,并且得到一个函数值,该函数值是字符数组的起始地址。函数的参数应该是一个指针,所以选项B)错误。

  • 第3题:

    有以下定义:includechara[10],*b=a;不能给数组a输入字符串的语句是A.gets(a)B.gets(a[

    有以下定义: #include <stdio.h> char a[10],*b=a; 不能给数组a输入字符串的语句是

    A.gets(a)

    B.gets(a[0])

    C.gets(&a[0]);

    D.gets(b);


    正确答案:B
    解析:本题考核的知识点是函数gets()的应用。函数gets()的调用形式为gets(str_adr);str_adr是存放字符串的起始地址。可以是字符数组名、字符指针或字符数组元素的地址。gets函数用来从终端键盘读入字符串(包括空格符),直到读入一个换行符为止。换行符读入后,不作为字符串的内容。本题中定义一个长度为10的字符数组,和一个指针变量b,并且通过赋值让它指向数组a;选项A。选项B。选项C和选项D中只有选项B中gets函数的参数a[0]不能表示数组a的首地址,故选项B不正确。所以,4个选项中选项B符合题意。

  • 第4题:

    Fueling results in the collection of waste oil in drip pans and containers. Which is an approved method of disposing of the waste oil?

    A.Draining it overboard when the vessel gets underway

    B.Placing it in proper disposal facilities

    C.Adding sinking agents and discharging it into the water

    D.Mixing it with dispersants before draining it overboard


    正确答案:B

  • 第5题:

    You execute the following command to create two consumer groups, FIN_GROUP1 and PAY_GROUP1, for a plan,PROD_PLAN:  BEGIN  DBMS_RESOURCE_MANAGER.CREATE_SIMPLE_PLAN (SIMPLE_PLAN => ’prod_plan’,  CONSUMER_GROUP1 => ’fin_group1’,  GROUP1_CPU => 80,  CONSUMER_GROUP2 => ’pay_group1’,  GROUP2_CPU => 20);  END;  Which three statements are true?()

    • A、SYS_GROUP gets 100% CPU resources at level 1.
    • B、FIN_GROUP1 gets 80% CPU resources at level 1.
    • C、FIN_GROUP1 gets 80% CPU resources at level 2.
    • D、PAY_GROUP1 gets 20% CPU resources at level 1.
    • E、PAY_GROUP1 gets 20% CPU resources at level 2.
    • F、OTHER_GROUP gets 100% CPU resources at level 1.
    • G、OTHER_GROUP gets 100% CPU resources at level 2.

    正确答案:A,C,E

  • 第6题:

    给了两段documentation里的描述,问这个时候发哪种类型的ICMP包。 The interface on which the packet comes into the router is the same interface on which the packet gets routed out. The subnet or network of the source IP address is on the same subnet or network of the next-hop IP address of the routed packet.


    正确答案:ICMP类型5重定向消息。

  • 第7题:

    A mail server keeps shutting down. The administrator gets an error message over temperature error. Which of the following should the administrator replace FIRST?()

    • A、 Power supply fan
    • B、 CPU fan
    • C、 Heat sink
    • D、 Case fan

    正确答案:B

  • 第8题:

    Which property of the Label control gets/sets the identifer for a server control that the Label control is associated with?()

    • A、ClientID
    • B、ID
    • C、AssociatedControlID
    • D、ControlID

    正确答案:C

  • 第9题:

    单选题
    Which of the following is NOT true?
    A

    Dubai has created many man-made islands.

    B

    There are many foreigners working in Dubai.

    C

    Many international visitors come to Dubai every year.

    D

    Dubai now gets money mainly from selling oil.


    正确答案: B
    解析:
    细节理解题。第二段提到the city gets its money mainly from business, not oil,由此可知,D项表述错误。

  • 第10题:

    单选题
    Due to media failure you lost one of the data files belonging to the USERS tablespace, and the tablespace is not available to use. Which statement regarding the status of the database is true?()
    A

    The database remains open.

    B

    The database gets dismounted.

    C

    The database becomes read only.

    D

    The database instance gets aborted.

    E

    The database gets shut down automatically.

    F

    The status of the database depends on the status of the USERS tablespace.


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

  • 第11题:

    单选题
    Fueling results in the collection of waste oil in drip pans and containers. Which is an approved method of disposing of the waste oil? ()
    A

    Draining it overboard when the vessel gets underway

    B

    Placing it in proper disposal facilities

    C

    Adding sinking agents and discharging it into the water

    D

    Mixing it with dispersants before draining it overboard


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

  • 第12题:

    单选题
    Which of the following shows the proper pronunciation of the segment know it in connected speech?
    A

    /nəuit/

    B

    /nəu wit/

    C

    /nəujit/

    D

    /nəurit/


    正确答案: A
    解析:

  • 第13题:

    设有下列程序: include include main() { int i; char si 10],ti 10]; gets(

    设有下列程序:

    include<stdio.h>

    include<string.h>

    main()

    { int i;

    char si 10],ti 10];

    gets(t);

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

    { gets(s);

    if(strcmp(t,s)<0)strcpy(t,s);

    }

    printf("%s\n",t);

    }

    程序运行后,从键盘上输入(<CR>代表回车符):CDEF<CR>BADEF<CR>QTHRG<CR>,则程序的输出结果是______。


    正确答案:QTHRG
    QTHRG 解析:strcmp(t,s)函数用来比较t和s所指字符串的大小,若t>s,则函数值大于0;若t=s,则函数值等于0;若ts,则函数值小于0。strcpy(t,s)函数的功能是把字符数组,所指字符串的内容复制到字符数组t所指的存储空间中。
    本题中,t[10]="CDEF".第一次循环,s[10]="BADEF",if语句的控制条件strcmp(t,s)0不成立,接着执行第二次循环,s="QTHRG”, if语句的控制条件strcmp(t,s)0成立,执行下列的语句,将字符数组s所指字符串的内容复制到字符数组t所指的存储空间中,然后输出字符数组t。

  • 第14题:

    以下程序includemain(){char a1[80],a2[80],*s1=a1,*s2=a2; gets(s1);gets(s2) if(!s

    以下程序 #include<string.h> main() { char a1[80],a2[80],*s1=a1,*s2=a2; gets(s1);gets(s2) if(!strcmp(s1,s2))printf("*"); else printf("#"); printf("%d\n",strlen(strcat(s1,s2))); } 如果从键盘上输入: book<回车> book<空格><回车> 则输出结果是( )

    A.*8

    B.#9

    C.#6

    D.*9


    正确答案:B

  • 第15题:

    有以下定义 include char a[10],*b=a; 不能给a数组输入字符串的语句是A.gets(A)B.gets

    有以下定义

    #include <stdio.h>

    char a[10],*b=a;

    不能给a数组输入字符串的语句是

    A.gets(A)

    B.gets(a[0]);

    C.gets(&a[0]);

    D.gets(B) ;


    正确答案:B
    解析:函数gets()的调用形式为gets(str_adr);str_adr是存放字符串的起始地址。可以是字符数组名、字符指针或字符数组元素的地址。gets函数用来从终端键盘读入字符串(包括空格符),直到读入一个换行符为止。换行符读入后,不作为字符串的内容。本题中定义一个长度为10的字符数组,和一个指针变量b,并且通过赋值让它指向数组a。gets函数的参数a[0]不能表示数组a的首地址。

  • 第16题:

    Which of the following does NOT show the proper rhythmic pattern of the sentence


    A.'What' s the 'matter

    B.The 'sweater is 'beautiful.

    C.He 'started 'counting it.

    D.'He usually 'gets up at 'six o 'clock.

    答案:D
    解析:
    考查句子重读。一般来说,在句子中需重读的词都是实词,比如,名词、动词(除be动词和助动词外)、形容词、副词、指示代词等;不重读的多为虚词,比如,冠词、连词、介词、人称代词、相互代词等。但这也不是绝对的.一个词在句中重读与否,同它在句中所起的意义和作用有密切的关系。D项中的he为人称代词.属于虚词.不重读。故选D。

  • 第17题:

    若有定义chara[10],*b=a;不能给数组a输入字符串"youknow"的语句是()

    • A、gets(a);
    • B、scanf("%s",a);
    • C、gets(&a[0]);
    • D、gets(b);

    正确答案:B

  • 第18题:

    A mail server keeps shutting down. The administrator gets an error message over temperature error? Which of the following should the administrator replace FIRST?()

    • A、Power supply fan
    • B、CPU fan
    • C、Heat sink
    • D、Case fan

    正确答案:B

  • 第19题:

    Due to media failure you lost one of the data files belonging to the USERS tablespace, and the tablespace is not available to use. Which statement regarding the status of the database is true?()

    • A、The database remains open.
    • B、The database gets dismounted.
    • C、The database becomes read only.
    • D、The database instance gets aborted.
    • E、The database gets shut down automatically.
    • F、The status of the database depends on the status of the USERS tablespace.

    正确答案:A

  • 第20题:

    单选题
    A mail server keeps shutting down. The administrator gets an error message over temperature error. Which of the following should the administrator replace FIRST?()
    A

     Power supply fan

    B

     CPU fan

    C

     Heat sink

    D

     Case fan


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

  • 第21题:

    问答题
    给了两段documentation里的描述,问这个时候发哪种类型的ICMP包。 The interface on which the packet comes into the router is the same interface on which the packet gets routed out. The subnet or network of the source IP address is on the same subnet or network of the next-hop IP address of the routed packet.

    正确答案: ICMP类型5重定向消息。
    解析: 暂无解析

  • 第22题:

    多选题
    You execute the following command to create two consumer groups, FIN_GROUP1 and PAY_GROUP1 for a plan, PROD_PLAN:  BEGIN  DBMS_RESOURCE_MANAGER.CREATE_SIMPLE_PLAN (SIMPLE_PLAN =>’prod_plan’,  CONSUMER_GROUP1 => ’fin_group1’,  GROUP1_CPU => 80,  CONSUMER_GROUP2 => ’pay_group1’,  GROUP2_CPU => 20);  END;  Which three statements are true? ()
    A

    SYS_GROUP gets 100% CPU resources at level 1.

    B

    FIN_GROUP1 gets 80% CPU resources at level 1.

    C

    FIN_GROUP1 gets 80% CPU resources at level 2.

    D

    PAY_GROUP1 gets 20% CPU resources at level 1.

    E

    PAY_GROUP1 gets 20% CPU resources at level 2.

    F

    OTHER_GROUP gets 100% CPU resources at level 1.

    G

    OTHER_GROUP gets 100% CPU resources at level 2.


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

  • 第23题:

    单选题
    Which of the following does NOT show the proper rhythmic pattern of the sentence?
    A

    ‘What's the 'matter?

    B

    The ‘sweater is’ beautiful.

    C

    He ‘started 'counting it.

    D

    ‘He usually 'gets up at ‘six O'clock.


    正确答案: D
    解析:

  • 第24题:

    单选题
    Which of the following is the best revision of the underlined portion of sentence 8(reproduced below)?You have probably had the experience of thinking about a paper or a math problem for so long that it’s like one’s brain gets frozen.
    A

    it seems that your brain gets frozen

    B

    one’s brain gets frozen

    C

    your brain seems to freeze

    D

    your brains seem to freeze

    E

    one’s brain seems to freeze


    正确答案: D
    解析:
    这句话开始用的代词为you,因此这个代词的使用应保持一致。D选项不正确,因为一个只有一个大脑。