当前位置:网站首页>CSDN21天学习挑战赛——封装(06)
CSDN21天学习挑战赛——封装(06)
2022-08-11 07:03:00 【二哈喇子!】
活动地址:CSDN21天学习挑战赛
学习的最大理由是想摆脱平庸,早一天就多一份人生的精彩;迟一天就多一天平庸的困扰。各位小伙伴,如果您:
想系统/深入学习某技术知识点…
一个人摸索学习很难坚持,想组团高效学习…
想写博客但无从下手,急需写作干货注入能量…
热爱写作,愿意让自己成为更好的人…
…
封装
面向对象的三大特征:封装,继承,多态。
什么是封装? 隐藏实现细节,暴露出合适的访问方式。(合理隐藏、合理暴露)
**
封装的实现步骤
一般对成员变量使用private(私有)关键字修饰进行隐藏,private修饰后该成员变量就只能在当前类中访问。
提供public修饰的公开的getter、setter方法暴露其取值和赋值。


封装的好处小结
加强了程序代码的安全性。
适当的封装可以提升开发效率,同时可以让程序更容易理解与维护。
学习日记
1.封装是什么,一般封装怎么体现出来?
面向对象的三大特征之一,合理隐藏,合理暴露。
一般会把成员变量使用private隐藏起来。
通过getter和setter方法暴露其访问。
2.封装有什么好处?
加强了程序代码的安全性。
适当的封装可以提升开发效率,同时可以让程序更容易理解与维护
边栏推荐
- The softmax function is used in TF;
- 2022-08-10 Group 4 Self-cultivation class study notes (every day)
- Test cases are hard?Just have a hand
- leetcode:69. x 的平方根
- matrix multiplication in tf
- 1002 Write the number (20 points)
- 4.1 - Support Vector Machines
- Four startup modes of Activity
- Use tf.argmax in Tensorflow to return the index of the maximum value of the tensor along the specified dimension
- 1076 Wifi Password (15 points)
猜你喜欢
3.1-Classification-probabilistic generative model

Use tf.argmax in Tensorflow to return the index of the maximum value of the tensor along the specified dimension

The softmax function is used in TF;
3.1-分类-概率生成模型

囍楽云任务源码
2.1 - Gradient Descent

How to choose professional, safe and high-performance remote control software

2022年中国软饮料市场洞察

1036 跟奥巴马一起编程 (15 分)

tf.cast(), reduce_min(), reduce_max()
随机推荐
国密规范 SM2 SM3 SM4
My creative anniversary丨Thank you for being with you for these 365 days, not forgetting the original intention, and each is wonderful
欢迎加入sumarua网络安全交流社区
项目2-年收入判断
How to choose professional, safe and high-performance remote control software
接口测试的基础流程和用例设计方法你知道吗?
prometheus学习5altermanager
【软件测试】(北京)字节跳动科技有限公司终面HR面试题
为什么C#中对MySQL不支持中文查询
break pad源码编译--参考大佬博客的总结
语音信号处理:预处理【预加重、分帧、加窗】
MindManager2022全新正式免费思维导图更新
Conditional statements in TF; where()
1.1-回归
为什么我使用C#操作MySQL进行中文查询失败
js判断图片是否存在
1002 Write the number (20 points)
Service的两种启动方式与区别
LeetCode brushing series -- 46. Full arrangement
Write a resume like this, easy to get the interviewer