您的位置:首页 > 其它

Overriding && Overloading

2015-04-01 13:22 204 查看
Overriding

To override a method, the method must be defined in the subclass using the same signature and the same return type as in its superclass.

It is the method that used between superclass and subclass.

 

Overloading

Overloading means to define multiple methods with the same name but different signatures, like different params, return type.

 

Overriding VS Overloading

Overloading means to define multiple methods with the same name but different signatures, like different params, return type.

Overriding means to provide a new implementation for a method in the subclass.

 

 

 

 
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息