请看代码,回答下面的问题。TypeTMammal=ClassProcedure Walk;…..end;{end of TManmml}procedure TMammal.Walk;beginShowMessage(‘Result is Mammal Walk’);end;TDog=Class(TMammal)Procedure Walk;end;procedure TDog.Walk;beginShowMessage(‘Result is Dog Walk’);end;varMammal:TMammal

题目

请看代码,回答下面的问题。

Type

TMammal=Class

Procedure Walk;

…..

end;{end of TManmml}

procedure TMammal.Walk;

begin

ShowMessage(‘Result is Mammal Walk’);

end;

TDog=Class(TMammal)

Procedure Walk;

end;

procedure TDog.Walk;

begin

ShowMessage(‘Result is Dog Walk’);

end;

var

Mammal:TMammal;

dog:TDog;

begin

Mammal:=TDog.Create;

Mammal.Walk;

Mammal.Free;

end;

上面代码中,最后的输出结果是:( )

A.‘Result is Dog Walk’

B.‘Result ia Mannal Walk’


相似考题
更多“请看代码,回答下面的问题。 Type TMammal=Class Procedure Walk; …..end;{end of TManmml} pro ”相关问题
  • 第1题:

    以下能正确定义数据类型TelBook的代码是

    A.TypeTelBook Name As String*10 TelNum As Integer EndType

    B.Type TelBook Name As String*10 TelNum As Integer End TelBook

    C.Type TelBook Name String*10 TelNum Integer EndTypeTelBook

    D.Typedef TelBook Name String*10 TelNum Integer End Type


    正确答案:A
    解析:所列项错误主要集中在Type语句的使用格式上。B项End后面应接Type;C项End后面多出了TelBook,而且元素与数据类型之间缺少关键字As;D项元素与数据类型之间也是缺少关键字As。

  • 第2题:

    设在工程中定义了如下类型: Type stutype ino As Integer stmame As String*20 strsex As String*1 smark As Single End Type 在窗体上正确使用这个类型的是下列哪个操作( )。

    A.Sub Command1_click() Dimstudent As Stutype With student .ino=12 .strname=smith .strsex=男 .smark=89 End With End Sub

    B.Sub Command1_Click() Dim student As Stutype With student .ino=12 .strname="smith" .strsex="男" .smark=89 End With End Sub

    C.Sub Command1_Click() Dim student As Stutype With Stutype .ino=12 .strname="smith" .strsex="男" .smark=89 End With End Sub

    D.Sub Command1_click() Dim student As Stutype With student .ino=12 .strname="smith" .strsex="男" .smark=89 End student End Sub


    正确答案:B
    解析:本题考查为记录类型变量student赋值。使用With语句可以对某个对象执行一系列的语句,而不用重复指出对象的名称。其语法如下:With记录类型变量.记录类型变量成员名=要赋的值…EndWith给记录类型变量中的字符串型成员赋值时要加双引号。

  • 第3题:

    设在工程中定义了下列类型:

    Type Stutype

    ino As Integer

    strname As String*20

    strsex As String*1

    smark As Single

    End Type

    在窗体上正确使用这个类型的是下列哪个操作( )。

    A.Sub Command1_Click() Dim student As Stutype With student .ino=12 .Strname=smith .strsex=男 .smark=89 End With End Sub

    B.Sub Command1_Click() Dim Student As Stutype With student .ino=12 .strname="smith" .strsex="男" .smark=89 End With End Sub

    C.Sub Comnland1_Click() Dim student As Stutype With Stutype .ino=12 .strname="smith" .strsex="男" .smark=89 End With End Sub

    D.Sub Command1_Click() Dim student As Stutype With student .ino=12 .Strname="smith" .strsex="男" .smark=89 End student End Sub


    正确答案:B
    解析:本题考查为记录类型变量student赋值。使用With语句可以对某个对象执行一系列的语句,而不用重复指出对象的名称。其语法如下:
    With记录类型变量
    .记录类型变量成员名=要赋的值

    End With
    给记录类型变量中的字符串型成员赋值时要加双引号。

  • 第4题:

    下列数据类型定义中,正确的是

    A.Type Student Num As Long Name As String End Type

    B.Type Student Num As Integer Name As String * 10 End Type

    C.Private Type Num As Long Score As Single End Type

    D.Private Type Student Name As String Score(10)As String * 10 End Type


    正确答案:B
    解析:自定义类型的一般格式为:
      Type数据类型名>
      成员名> As 类型名
      ……
      End Type
      根据自定义类型的格式可以排除C、D两项。成员名如果是字符串类型时,一般要指明字符串长度。排除选项A,只有B项是正确的。

  • 第5题:

    以下能正确定义数据类型TelBook的代码是______。

    A.Type TelBook Name As String*10 TelNum As Integer End Type

    B.Type TelBook Name As String*10 TelNum AS Integer End TelBook

    C.Type TelBook Name String*10 TelNum Integer End Type TelBook

    D.Typedef TelBook NameString*10 TelNum Integer EndType


    正确答案:A
    解析:用户可以利用Type语句定义自己的数据类型,其格式如下:
    Type数据类型名
    数据类型元素名As类型名
    数据类型元素名As类型名
    ......
    End Type

  • 第6题:

    以下能正确定义数据类型TelBook的代码是( )。

    A.Type TelBook Name As String*10 TelNum As Integer End Type

    B.Type TelBook Name As String*10 TelNum As Integer End TelBook

    C.Type TelBook Name String*10 TelNum Integer. EndType TelBook

    D.Typedef TelBook Name String*10 TelNum Integer End Type


    正确答案:A

  • 第7题:

    请判断下列代码在程序关闭时,正确的对象释放顺序

    TMybutton=class(Tbutton)

    Protected

    Destructor Destroy;override;

    End;

    …………

    destructor TMyButton.Destroy;

    Begin

    inherited;

    Application.MessageBox(PChar(Name),’Destroy’,mb_ok);

    end;

    var AButton,BButton:TMyButton;

    procedure TForm1.FormCreate(Sender:TObject);

    begin

    Abutton:=TmyButton.Create(Nil);

    With AButton do

    begin

    Parent:=form1;

    Top:=100;

    Left:=100;

    Visible:=True;

    Name:=’ABtn’;

    end;

    BButton:=TMyButton.Create(Application);

    With BButton do

    begin

    Parent:=Form1;

    Top:=100;

    Left:=200;

    Visible:=True;

    Name:=’BBtn’;

    end;

    procedure TForm1.FormDestroy(Sender:TObject);

    begin

    …………

    end;

    A.BButton.Destroy->Form1.Destroy->AButton.Destroy

    B.上述都不对,应该手工调用 Abutton.free,否则会造成AButton没有释放的

    错误

    C.Form1.Destroy->AButton.Destroy->BButton.Destroy

    D.AButton.Destroy->Form1.Destroy->BButton.Destroy


    正确答案:B

  • 第8题:

    End-to-end QoS is maintained in the Cisco WLAN deployment model by utilizing what parameter in lieu of 802.1p?()

    • A、 IP precedence
    • B、 type of service (ToS)
    • C、 class of service (CoS)
    • D、 differentiated services code point (DSCP)

    正确答案:D

  • 第9题:

    尽端铁路枢纽 stub-end type railway terminal


    正确答案: 位于滨海或内陆铁路网的尽端,仅有一端与铁路网相衔接的铁路枢纽。

  • 第10题:

    You work as the application developer at Hi-Tech.com. You create a new custom dictionary named MyDictionary. Choose the code segment which will ensure that MyDictionary is type safe?()

    • A、 Class MyDictionary Implements Dictionary (Of String,String)
    • B、 Class MyDictionary Inherits HashTable
    • C、 Class MyDictionary Implements IDictionary
    • D、 Class MyDictionary     End Class     Dim t as New Dictionary (Of String, String)     Dim dict As MyDIctionary= CType (t,MyDictionary)

    正确答案:A

  • 第11题:

    单选题
    You are creating a job class. You have issued the following command to create the job class:  SQL> BEGIN   DBMS_SCHEDULER.CREATE_JOB_CLASS(        JOB_CLASS_NAME => ’LOW_PRIORITY_CLASS’,        RESOURCE_CONSUMER_GROUP => ’LOW_GROUP’,        LOGGING_LEVEL => DBMS_SCHEDULER.LOGGING_FULL,        LOG_HISTORY => 1200,   COMMENTS => ’LOW JOB PRIORITY CLASS’);        END;        SQL> /   What will be the result of the above command?()
    A

     The command will be executed successfully.

    B

     The command will fail because RESOURCE_CONSUMER_GROUP is an invalid parameter in the  DBMS_SCHEDULER.CREATE_JOB_CLASS procedure.

    C

     The command will fail because LOGGING_LEVEL is an invalid parameter in the DBMS_SCHEDULER.CREATE_JOB_CLASS procedure.

    D

     The command will fail because LOG_HISTORY is an invalid parameter in the DBMS_SCHEDULER.CREATE_JOB_CLASS procedure.

    E

     The command will fail because 1200 is an invalid value for the LOG_HISTORY parameter in the  DBMS_SCHEDULER.CREATE_JOB_CLASS procedure.


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

  • 第12题:

    单选题
    End-to-end QoS is maintained in the Cisco WLAN deployment model by utilizing what parameter in lieu of 802.1p?()
    A

     IP precedence

    B

     type of service (ToS)

    C

     class of service (CoS)

    D

     differentiated services code point (DSCP)


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

  • 第13题:

    以下能正确定义数据类型TelBook的代码是 ______。

    A.Type TelBook Name As String*10 TelNum As Integer End Type

    B.Type TelBook Name As String*10 TelNun As Integer End TelBook

    C.Type TelBook Name String*10 TelNum Integer End Type TelBook

    D.TypedefTelBook Name String*10 TelNum Integer End Type


    正确答案:A
    解析:用户可以利用Type语句定义自己的数据类型,其格式如下:
      Type数据类型名
      数据类型元素名As类型名
      数据类型元素名As类型名
      End Type

  • 第14题:

    要建立一个随机文件记录学生的信息,如下定义了学生的记录类型,由学号、姓名、5门课程成绩(百分制)组成,下列的定义正确的是( )。

    A.Type sru no As Integer name As String score(1 To 5)As Single End Type

    B.Type stu no As Integer name As String*10 score()As Single End Type

    C.Type stu no As Integer name As String*10 score(1 To 5)As Single End Type

    D.Type stu no As Integer name As String score()As Single End Type


    正确答案:C
    解析:可以用Type语句创建用户定义的类型,注意该语句必须置于模块的声明部分。其格式如下:
      Type数据类型名
      数据类型元素名 As类型名
      数据类型元素名 As类型名
      End Type
      在记录数据类型中的元素可以是变长字符串,也可以是定长字符串。当在随机文件中使用时,必须使用定长字符串,一般格式是:String *常量。另外,在记录类型中不能使用动态数组。

  • 第15题:

    写出下列程序代码运行的结果【】。 include class A{public:virtual void disp() {cout

    写出下列程序代码运行的结果【 】。

    include<iostream.h>

    class A{

    public:

    virtual void disp() {cout<<" calss A!" <<(end1;}

    }:

    class B: public A{

    public:

    void disp() {cout<<" class B! " <<end1:}

    };

    class C: public A{

    public:

    void disp() {cout<<"class C! " (<end1;}

    };

    void main() {

    A a, *ptr;

    B b;

    C c;

    a. disp();

    b. disp();

    c. disp();

    ptr=&b;

    ptr->disp();

    ptr=&c;

    ptr->disp():

    }


    正确答案:class A! class B! class C! class B! class C!
    class A! class B! class C! class B! class C!

  • 第16题:

    要建立一个随机文件记录学生的信息,下列定义了学生的记录类型,由学号、姓名、五门课程成绩(百分制)组成,下列的定义正确的是( )。

    A.Type stu no As Integer name As String score(1 To 5)As Single End Type

    B.Type stu no As Integer name As String*10 score()As Single End Type

    C.Type stu no As Integer name As String*10 score(1 To 5)As Single End Type

    D.Type stu no As Integer name As String score()As Single End Type


    正确答案:C
    解析: 可以用Type语句创建用户定义的类型,注意该语句必须置于模块的声明部分。其格式如下:
    Type 数据类型名
    数据类型元素名As类型名
    数据类型元素名As类型名
    ……
    End Type
    在记录数据类型中的元素可以是变长字符串,也可以是定长字符串。当在随机文件中使用时,必须使用定长字符串,一般格式是:String*常量。另外,在记录类型中不能使用动态数组。

  • 第17题:

    第三题:请看如下代码

    <%

    TestString="Test"

    TestA

    TestB

    Response.write TestString

    Sub TestA()

    TestString="TestA"

    End Sub

    Sub TestB()

    Dim TestString

    TestString="TestB"

    End Sub

    %>

    这段代码执行后,运行结果是什么?并解释一下为什么?


    正确答案:
      

  • 第18题:

    下面程序输出的结果为 #include" iostream.h" class A { public: A( ) { cout < < "CLASS A" < < end1;} ~ A( ) { } }; class B:public A { public: B( ){ cout < < "CLASS B" < < end1;} ~ B( ) { } }; void main( ) { A * p; p=new B; B * q;

    A.CLASS A CLASS B

    B.CLASS A CLASS B CLASS B

    C.CLASS A CLASS B CLASS A CLASS B

    D.CLASS A CLASS B CLASS B CLASS B


    正确答案:C
    解析:每实例化一个类就要调用其构造函数,结束运行该实例后调用析构函数。注意:类的实例化和构造函数、析构函数的调用方式和何时调用。

  • 第19题:

    Which traversal method for a binary tree does the following Pascal code illustrate? procedure traverse (p:pointer); begin if p<>nil then begin traverse(p ↑ .left); process(p); traverse(p ↑ .right); end end;

    A.preorder

    B.postorder

    C.reorder

    D.inorder


    正确答案:D

  • 第20题:

    Given a Cisco Unified Computing System, which is a valid port type in end-host mode?()

    • A、 Server
    • B、 End device
    • C、 Node
    • D、 Host
    • E、 Virtual

    正确答案:A

  • 第21题:

    You are creating a job class. You have issued the following command to create the job class:  SQL> BEGIN   DBMS_SCHEDULER.CREATE_JOB_CLASS(        JOB_CLASS_NAME => ’LOW_PRIORITY_CLASS’,        RESOURCE_CONSUMER_GROUP => ’LOW_GROUP’,        LOGGING_LEVEL => DBMS_SCHEDULER.LOGGING_FULL,        LOG_HISTORY => 1200,   COMMENTS => ’LOW JOB PRIORITY CLASS’);        END;        SQL> /   What will be the result of the above command?()

    • A、 The command will be executed successfully.
    • B、 The command will fail because RESOURCE_CONSUMER_GROUP is an invalid parameter in the  DBMS_SCHEDULER.CREATE_JOB_CLASS procedure.
    • C、 The command will fail because LOGGING_LEVEL is an invalid parameter in the DBMS_SCHEDULER.CREATE_JOB_CLASS procedure.
    • D、 The command will fail because LOG_HISTORY is an invalid parameter in the DBMS_SCHEDULER.CREATE_JOB_CLASS procedure.
    • E、 The command will fail because 1200 is an invalid value for the LOG_HISTORY parameter in the  DBMS_SCHEDULER.CREATE_JOB_CLASS procedure.

    正确答案:E

  • 第22题:

    单选题
    Given a Cisco Unified Computing System, which is a valid port type in end-host mode?()
    A

     Server

    B

     End device

    C

     Node

    D

     Host

    E

     Virtual


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

  • 第23题:

    单选题
    You work as the application developer at Hi-Tech.com. You create a new custom dictionary named MyDictionary. Choose the code segment which will ensure that MyDictionary is type safe?()
    A

     Class MyDictionary Implements Dictionary (Of String,String)

    B

     Class MyDictionary Inherits HashTable

    C

     Class MyDictionary Implements IDictionary

    D

     Class MyDictionary     End Class     Dim t as New Dictionary (Of String, String)     Dim dict As MyDIctionary= CType (t,MyDictionary)


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