Thinking in java第一章对象导论

  这一章,做笔记感觉不是很好做。每个人又每个人对面向对象的理解。这里说一下书里的关键字,穿插一下自己的思想

  面向对象的编程语言里面很流行的一句话,一切都是对象。面向对象的核心就是抽象,抽象的能力有大有小,是决定程序员高度的一个方面

  程序员的爱情里面有句话。我能抽象出整个世界 ,唯独抽象不出你。

  最初的 OOP 语言被人描述是这个样子的

  一切都是对象。是啊,在自然界,什么都是物品,是动物植物,还是菌类生物。

  对象之间通过消息告知彼此应该做什么,其实就是方法的调用。

  类其实就是类型的意思,任何对象都属于一种数据类型,这个类型是程序员自己创造的等同于程序内置的数据类型一样,比如int,String等等。差别只是怎么定义你说了算。

  属于同种类型的两个对象必然能够结构相同的信息,就是有相同的方法供程序员调用。

  面向对象的一切基础就是为了复用。

  在谈到继承的时候作者指出,过多的继承会导致抽象的混乱,建议使用包含,对象A包含对象B,对象B为对象A 的实例对象,一个对象可以拥有任意个实例对象。

  JAVA是单继承的,所有对象都继承自Object对象,继承也是为了更好的复用。

  JAVA是单继承的,这样有一定的缺陷,为了弥补这样的缺陷,JAVA提供了接口 这一概念,接口为类提供了扩展。

  接口提供对象可以进行的行为但是没有给出实现,让对象自己实现,使得程序变得更加灵活。

  任何实现某一接口的对象必须实现此接口定义的所诱发方法。

  UML个人觉得是面向对象理解的强有力的工具,很多初学者看到UML图觉得画那些图没有意义

  但是其实作用是很大的,有助于帮助程序员更好的抽象,图让人更清楚对象之间的关系,清楚关系让人更容易抽象。

  第一章的内容比较抽象就写到这里,希望大家都能再脑袋里面不断的抽象OOP 这个概念。

  

  

  

  

转载于:https://www.cnblogs.com/wzforgame/archive/2013/04/10/3013316.html

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/274295.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

Android SlidingMenu插件的使用

1、在github上下载了源码后 不知道如何使用,在折腾了一个晚上后终于弄好了 下载地址 https://github.com/jfeinstein10/SlidingMenu 下载完后,解压,然后先import 其中的library ,然后把项目名改为SlidingMenu 2、然后再到http…

css 字体字体图标_CSS基础知识:了解字体

css 字体字体图标In this tutorial, we’ll be learning about working with fonts in CSS!在本教程中,我们将学习有关在CSS中使用字体的知识! The font property is a shorthand property which can combine a number of sub-properties in a single d…

openstack quantum搭建过程中一些有用的链接

OpenvSwitch的概念和流程: http://blog.wachang.net/2013/03/openvswitch-fullbook-2-workflow-1/ OpenvSwitch的vlan模式: http://openvswitch.org/support/config-cookbooks/vlan-configuration-cookbook/ OpenvSwitch问答: http://openvsw…

mysql下载哪一代版本好_潮一代更好的设计

mysql下载哪一代版本好I think we can all agree that quarantined life has been strange. And while most of the day is comprised of the monotony of domestic life, I’ve been surprised at how much of my time is dominated by technology.我认为我们都可以同意隔离的…

预约清单ui设计_持续交付质量设计所需的UI清单

预约清单ui设计重点 (Top highlight)Over the past few months, my design team at StreetEasy has started experimenting in adding a “design buddy” check-in to the final stages of the design process.在过去的几个月中,我在StreetEasy的设计团队已开始尝试…

黑书上的DP例题

pagesectionnotitlesubmit1131.5.1例题1括号序列POJ11411161.5.1例题2棋盘分割POJ11911171.5.1例题3决斗Sicily18221171.5.1例题4“舞蹈家”怀特先生ACM-ICPC Live Archive1191.5.1例题5积木游戏http://202.120.80.191/problem.php?problemid12441231.5.2例题1方块消除http://…

静态创意和动态创意_我在22岁时学到的关于创意指导的知识

静态创意和动态创意During my last semester at college, I took a course titled “Collaborative Workshop”. The entire course focused on how to best collaborate within a team setting. We were placed into groups of 4 or 5. These were our “creative director” …

vim7.1在windows下的编码设置[转]

在gvm配置文件中: (gvim安装目录下的_vimrc文件中) """""""""""""""""""""""""""""&…

绝对编码和增量编码_用户体验设计师应该学习编码吗? 绝对

绝对编码和增量编码Even though I was trained as a graphic designer, I’ve never limited myself to that field exclusively. My particular interest in how things work didn’t allow me to stand still and as a young kid, I was already pulling apart all my toys t…

两个ID

在itpub上注册了ID googlgoracle ,发过不少的求助帖子。 http://www.itpub.net/home.php?modspace&dothread&viewme 在CSDN 上ID:googlg,注册时间挺早的2008年,一直也没有弄过。 http://write.blog.csdn.net/postlist http://blog.csdn.net/goo…

完美主义怎么解决_相信我,你不要完美主义

完美主义怎么解决Perfectionism to UXers is like a badge of honour. We pride ourselves on the attention to detail and the drive to constantly push our work to the next level. When I asked some of my clients who share this sentiment about perfectionism, they …

MDK linker和debug的设置以及在RAM中调试

有误或者表述不清楚请指出,谢谢 硬件:TQ2440开发板、jlink V8 固件 软件:J-LINK ARM 4.08i、MDK4.20 先解释下MDK中三种linker之间的区别 设置集中在option linker选项卡 1.采用Target对话框中的ram和rom地址。采用此方式,…

FS_S5PC100 UBOOT-2011.12移植,支持DM9000

在uboot中已经支持了DM9000驱动代码在drivers/net/目录下的dm9000x.c dm9000x.h 修改include/configs/smdkc100.h 文件,注释掉SMC911X的支持,添加对DM9000的支持//#define CONFIG_SMC911X 1 /* we have a SMC9115 on-board *///#define…

为什么ui框架设计成单线程_评估UI设计的备忘单

为什么ui框架设计成单线程Whether you’re evaluating your design proposals or giving feedback to a colleague during a design critique or an informal conversation, you may find this actionable cheat sheet valuable. It’s quick to digest and its questions are …

css 菜单栏悬停_在CSS中构建悬停菜单

css 菜单栏悬停A good menu design is an important part of any website or web app UI. Using only modern HTML and CSS, all kinds of menu combinations can be created to handle whatever user interactions are necessary. In this article, we’ll take a look at how…

一级学科和二级学科_在多学科团队中工作的6个障碍(以及如何解决这些问题)

一级学科和二级学科In a team with different skillsets, one can be hopeful and idealistic about the outcome. The goal is to work as one team, put users first and create awesome experiences. Unfortunately, things don’t always go as planned.在一支具有不同技能…

LBS核心技术解析(引子)

http://www.cnblogs.com/LBSer/archive/2013/04/25/3048754.html 引子: 人们常用“上知天文,下知地理”来形容一个人的博学,人们总是用三要素论“什么时间、什么地点,发生或干了什么事情”来描述一件事情,人们也常常借用“天时、地…

lynda ux_如何建立内部UX团队

lynda uxWritten by Cassandra Naji由卡珊德拉纳吉 ( Cassandra Naji)撰写 The needs of real users are increasingly driving enterprise software design and development. Since 2013, IBM has hired close to 1500 designers and UXers, establishing the largest design…

IE6下div宽高设置

IE6下宽高设置。IE下div 中没有内容时,设置宽高不起作用,必须设置div背景色,并使用滤镜。才能使Div填充目标区域。多用于,其他容器元素使用背景图片,但是背景图片的部分需要其他的事件支持。如跳转。可以使用放置div的…

财务软件开发_财务独立对软件开发人员的重要性

财务软件开发If you read this post, chances that you are a software developer who is seeking financial advice for smart money-saving or investment or early retirement.如果您阅读此文章,则您很可能是一名软件开发人员,正在为精明的省钱或投资…