• 2022-07-25 问题

    可以使用修饰符()定义类的静态方法 A: @staticmethod B: staticmethod C: @static D: static

    可以使用修饰符()定义类的静态方法 A: @staticmethod B: staticmethod C: @static D: static

  • 2021-04-14 问题

    style="padding-left:0px;">class Student: name="xxx" @staticmethod def show(): name="yyy" print(name,Student.name) @staticmethod def display(): show() s=Student() s.display() 结果:

    style="padding-left:0px;">class Student: name="xxx" @staticmethod def show(): name="yyy" print(name,Student.name) @staticmethod def display(): show() s=Student() s.display() 结果:

  • 2022-07-01 问题

    在定义类方法之前,必须先使用( )进行声明。 A: @classmethod B: @staticmethod C: 不需要事先声明

    在定义类方法之前,必须先使用( )进行声明。 A: @classmethod B: @staticmethod C: 不需要事先声明

  • 2022-06-04 问题

    在声明一个方法为类的静态方法,需要添加装饰符的名字为() A: property B: method C: classmethod D: staticmethod

    在声明一个方法为类的静态方法,需要添加装饰符的名字为() A: property B: method C: classmethod D: staticmethod

  • 1