




版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進行舉報或認領(lǐng)
文檔簡介
1、JAVA程序設(shè)計主要內(nèi)容nJava可以做什么?n介紹對象 nPrimitive Types, Wrappers, and Boxing n聲明和注釋 n構(gòu)造器和可見性 nStatic, Final, and 枚舉類型 n命名,操作和精度n繼承 n異常n接口Java可以做什么?nJava可以做什么?可以做什么?n介紹對象 nPrimitive Types, Wrappers, and Boxingn聲明和注釋 n構(gòu)造器和可見性 nStatic, Final, and 枚舉類型 n命名,操作和精度 n繼承 n異常n接口跨平臺 易用性nThreads nExceptions nGarbage col
2、lection run-time library njava.utilnjava.util.regexnjava.sqlJava平臺nJ2MEnJ2SEnJ2EEA Java Desktop Application 介紹對象nJava可以做什么?n介紹對象 nPrimitive Types, Wrappers, and Boxing n聲明和注釋 n構(gòu)造器和可見性 nStatic, Final, and 枚舉類型 n命名,操作和精度n繼承 n異常n接口對象和類n類:人n對象:張三n對象是類的一個實例屬性和方法n屬性(人.name)n方法(人.eat())nDemo(person1)Primit
3、ive Types, Wrappers, and Boxing nJava可以做什么?n介紹對象 nPrimitive Types, Wrappers, and Boxing n聲明和注釋 n構(gòu)造器和可見性 nStatic, Final, and 枚舉類型 n命名,操作和精度 n繼承 n異常n接口Primitive Typesnboolean (for true/false values) nchar (for character data, ultimately to be input or printed) nint, long, byte, short (for arithmetic o
4、n whole numbers)ndouble, float (for arithmetic on the real numbers)Wrappersnbooleanjava.lang.Booleanncharjava.lang.Characternint java.lang.Integernlongjava.lang.Longnbytejava.lang.Bytenshortjava.lang.Shortndouble java.lang.Doublenfloatjava.lang.FloatAutoboxing and Unboxing int i = 27; Integer myInt
5、= i; / autobox! Double dObj = 27.0; / autobox double d = dObj; / unbox, gets value 27.0 java.lang.Object npublic java.lang.Object(); / constructor public njava.lang.String toString(); npublic boolean equals(java.lang.Object); npublic native int hashCode(); npublic final Class getClass(); nprotected
6、native java.lang.Object clone() throws CloneNotSupportedException; / methods relating to thread programming npublic final native void notify(); npublic final void wait() throws InterruptedException; java.lang.String nString drinkPref = new String( I like tea ); nString drinkPref = I like tea; nStrin
7、g s = ABCD.toLowerCase(); 聲明和注釋nJava可以做什么?n介紹對象 nPrimitive Types, Wrappers, and Boxing n聲明和注釋 n構(gòu)造器和可見性 nStatic, Final, and 枚舉類型 n命名,操作和精度n繼承 n異常n接口聲明和注釋nif,else,while,forn注釋n/ This is a commentsn/* This is a lot of comments */n/* This is a lot of comments */構(gòu)造器和可見性nJava可以做什么?n介紹對象 nPrimitive Types,
8、Wrappers, and Boxing n聲明和注釋 n構(gòu)造器和可見性 nStatic, Final, and 枚舉類型 n命名,操作和精度 n繼承n異常n接口構(gòu)造器nDemo(Timestamp)import and PackagenPackagenimport可見性nprivatenprotectednpublic Java robot Static, Final, and 枚舉類型nJava可以做什么?n介紹對象 nPrimitive Types, Wrappers, and Boxing n聲明和注釋 n構(gòu)造器和可見性 nStatic, Final, and 枚舉類型 n命名,操作和
9、精度n繼承 n數(shù)據(jù) n異常n接口What you can make static nData nMethods nBlocks nClasses What Field Modifier final Means nData nMethods nClasses 枚舉類型enum Bread wholewheat, ninegrain, rye, french Bread todaysLoaf; todaysLoaf = Bread.rye; 命名,操作和精度nJava可以做什么?n介紹對象 nPrimitive Types, Wrappers, and Boxing n聲明和注釋 n構(gòu)造器和可見性
10、 nStatic, Final, and 枚舉類型 n命名,操作和精度n繼承 n異常n接口Keywords operators n+ -nn!n- + * / % = *= /= %= += -=n ninstanceof n=n= !=n& |n& | ? :n= =n&= = |=繼承nJava可以做什么?n介紹對象 nPrimitive Types, Wrappers, and Boxing n聲明和注釋 n構(gòu)造器和可見性 nStatic, Final, and 枚舉類型 n命名,操作和精度n繼承 n異常n接口繼承n動物(哺乳動物(貓,狗)nDemo(animal
11、)異常nJava可以做什么?n介紹對象 nPrimitive Types, Wrappers, and Boxing n聲明和注釋 n構(gòu)造器和可見性 nStatic, Final, and 枚舉類型 n命名,操作和精度n繼承 n異常n接口java異常術(shù)語 接口nJava可以做什么?n介紹對象 nPrimitive Types, Wrappers, and Boxing n聲明和注釋 n構(gòu)造器和可見性 nStatic, Final, and 枚舉類型 n命名,操作和精度n繼承 n異常n接口接口n僅僅定義服務(wù)和功能n干凈的(沒有任何具體實現(xiàn))n一個類可以實現(xiàn)多個接口n接口可以繼承接口n最低限度耦合一些
溫馨提示
- 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負責。
- 6. 下載文件中如有侵權(quán)或不適當內(nèi)容,請與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準確性、安全性和完整性, 同時也不承擔用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。
最新文檔
- 拔尖創(chuàng)新人才課題申報書
- 貴州課題申報書怎么寫的
- 低年級微型課題申報書
- 高校思政類課題申報書
- 教師課題申報評審書
- 化工課題申報書范文
- 黨務(wù)課題申報書范文模板
- 醫(yī)學(xué)課題申報書的撰寫
- 校史課題研究申報書
- 智能項目課題申報書范文
- 2025年湖南水利水電職業(yè)技術(shù)學(xué)院單招職業(yè)技能測試題庫參考答案
- 中央2025年中國科協(xié)所屬單位招聘社會在職人員14人筆試歷年參考題庫附帶答案詳解-1
- 2024年湖北省聯(lián)合發(fā)展投資集團有限公司人員招聘考試題庫及答案解析
- 造價咨詢服務(wù)方案進度計劃安排及保證措施
- 2024年全國統(tǒng)一高考英語試卷(新課標Ⅰ卷)含答案
- HALCON手冊簡體中文版
- 聲學(xué)原理及聲學(xué)測試
- 機構(gòu)占比分時指標(升級版)源碼作者:羅克hq
- 水利工程竣工決算表格
- 《夏洛特的網(wǎng)》導(dǎo)讀題
- 人防及地下停車場工程監(jiān)理大綱(完整版)
評論
0/150
提交評論