开发者

What is the difference Between Extends and Instantiation?

开发者 https://www.devze.com 2023-03-16 01:25 出处:网络
What is the difference Between Extends and Instan开发者_Python百科tiation?When you instantiate a class you are making an instance of that class. In other words you are making a copy of that class. Rea

What is the difference Between Extends and Instan开发者_Python百科tiation?


When you instantiate a class you are making an instance of that class. In other words you are making a copy of that class. Read more here

When you extend a class you inherit that class' attributes and methods. This way you can reuse that code in your own class without having to rewrite that functionality. Read more here

0

精彩评论

暂无评论...
验证码 换一张
取 消