python面向对象编程入门
时间:2014-05-26 07:26:27
收藏:0
阅读:287
一、定义一个只包含一个成员变量a、一个构造函数、一个get、一个set函数的类 |
1
2
3 |
class
ClassA( object ): def
__init__( self ): self ._a =
0 <br> def
get_a( self ):<br> return
self ._a<br> def
set_a( self , value):<br> self ._a =
value |
可以看到
评论(0)