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.pswp.cn/news/274295.shtml
繁體地址,請注明出處:http://hk.pswp.cn/news/274295.shtml
英文地址,請注明出處:http://en.pswp.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.如果您閱讀此文章,則您很可能是一名軟件開發人員,正在為精明的省錢或投資…