这个类里面的这两个方法有什么用呢?

WBOY
Release: 2016-06-23 13:13:59
Original
749 people have browsed it

就是这两个getfirstname和getlastname方法   这两个方法去掉不行吗   好像没有什么用吧 


回复讨论(解决方案)

由于 $firstName 和 $lastName 是保护模式的,外部不可访问
所以加了这些方法,以便有条件的使用

仅就你的代码而言,是有画蛇添足的嫌疑。但仍符合学院派的编程风格

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!