Blogger Information
Blog 20
fans 1
comment 2
visits 16776
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
补0930作业 实例演示子类和三种访问限制符的使用场景
月迎下弦的博客
Original
684 people have browsed it

实例演示子类的三个应用场景

1功能扩展

2代码复用

3方法重写

功能扩展.jpg代码复用.jpg方法重写.jpg 实例演示类成员的三种访问限制符的使用场景

1public(公用属性或方法) 类中可以访问,子类可以访问 ,类外可以访问

2protected(受保护的属性或方法) 类中可以访问 ,子类可以访问 ,类外不可以访问

3private(私有的属性或方法) 类中可以访问,子类不可访问 ,类外不可以访问

类中.jpg类外访问.jpg子类.jpg

Correction status:qualified

Teacher's comments:作业完成的相当棒, 直观, 特别是字体, 很舒服,但并不适合写代码
Statement of this Website
The copyright of this blog article belongs to the blogger. Please specify the address when reprinting! If there is any infringement or violation of the law, please contact admin@php.cn Report processing!
All comments Speak rationally on civilized internet, please comply with News Comment Service Agreement
0 comments