summaryrefslogtreecommitdiffstats
path: root/content/posts/深刻认识面向对象.md
diff options
context:
space:
mode:
Diffstat (limited to 'content/posts/深刻认识面向对象.md')
-rw-r--r--content/posts/深刻认识面向对象.md50
1 files changed, 50 insertions, 0 deletions
diff --git a/content/posts/深刻认识面向对象.md b/content/posts/深刻认识面向对象.md
new file mode 100644
index 0000000..2e785d3
--- /dev/null
+++ b/content/posts/深刻认识面向对象.md
@@ -0,0 +1,50 @@
+---
+abbrlink: 841546109
+categories:
+- 往昔
+cid: 99
+cover: images\2024\12\2743265221.jpg
+customSummary: null
+date: "2024-12-01T13:31:00+08:00"
+layout: post
+mathjax: auto
+noThumbInfoEmoji: null
+noThumbInfoStyle: default
+outdatedNotice: false
+parseWay: auto
+reprint: standard
+slug: 99
+status: publish
+tags:
+- Java
+- 笔记
+thumb: null
+thumbChoice: default
+thumbDesc: null
+thumbSmall: null
+thumbStyle: default
+title: 深刻认识面向对象
+updated: 2024/12/07 10:55:00
+---
+
+
+
+面向对象编程的好处
+
+> 按照**詹姆斯·高斯林**的看法,世间万物都是对象。好比要出去旅游,你要找到车这个对象调用他的行驶功能使用来带你出去旅游。
+
+所以面向对象编程的好处就是:**符合人类思维习惯,编程更简单,更直观**。
+# 程序中的对象到底是什么
+- 对象本质上是一种**特殊的数据结构**,很像数据库,但是数据库是持久存储的数据。体现出计算机各个学科的交叉。
+一开始设计的类就是一张表,后续在其他类中填入这张表的内容。
+# 对象是怎么出来的
+class也就是**类**,也称为**对象的设计图**(或者**对象的模板**)
+- 类里可以设计很多变量,用来说明对象可以处理什么数据。
+- 类里还可以设计很多的方法,描述对象有什么功能,也就是要对数据进行什么样的处理。
+接下来我们就可以在程序中new对象了
+**也就是先用class设计对象,然后再用class new出对象。**
+
+具体使用语法见上一篇文章[post cid="98" /]
+
+
+[2]: https://www.bilibili.com/video/BV1Cv411372m?spm_id_from=333.788.videopod.episodes&vd_source=c0385e4bcdefa80a5d3d394a8a23df4c&p=69