为什么要明确写入"民营及QUOT ;? [英] Why explicitly write "private"?

查看:132
本文介绍了为什么要明确写入"民营及QUOT ;?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

由于字段是隐式私有的,为什么会出现在书籍,文章等经常使用明确的declaraion?

As fields are implicitly private, why there is often explicit declaraion used in the books, articles etc.?

推荐答案

由于默认的访问级别跨语言各不相同,而且许多人在一种以上的语言进行编程。这很容易变得混乱,无论是作为作者或作为后来有人阅读代码,从而显的是比隐更好对付。

Because default access levels vary across languages, and many people program in more than one language. It's easy to become confused, either as the author or as someone reading the code later, thus explicit is nicer to deal with than implicit.

这篇关于为什么要明确写入"民营及QUOT ;?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆