继承
{1,2,3}
{1,2,3,4,5}
class foo(object):
def __init__(self, arg)
self.a = 100;
def doAction(self, arg1, arg2)
self.b = arg1
self.c = arg2
class child(foo):
def __init__(self, arg)
super(self,child).__init__(self, arg)
self.doAciton(self,1,2)
pass
_a = child(1);
print _a.a
overwrite
多态
a->run,
b->run,
c->run,
for(int i = 0; i < size; i++)
v[i]->run();
封装
public:
int a;
private:
int b;
抽象
class foo
{
public:
interface void a() = 0;
public run()
{
1
2
3
sgfgfsdg = a();
1
2
3
}
}
class method
{
public void foo(interger a, interger b, interger...mmmm)
{
}
}
method a = new method();
a.foo(1,2,3);
a.foo(1,2,3,4);
a.foo(1,2,3,4,5);
def foo(a, *b)
pass
foo(1, 1,2,3);
def foo2
foo *b = new foo();
b->run();
class child : public foo
{
}
类的属性&实例的属性
b = new foo(1,2);
c = new foo(3,4)
class foo()
a = 0;
def __init__(self, x, y)
self.c = x
seld.d = y
self.level = xxxx;
self.curExp = aaa;
#self.isUsed = true;
print x,y