注冊 | 登錄讀書好,好讀書,讀好書!
讀書網(wǎng)-DuShu.com
當(dāng)前位置: 首頁出版圖書科學(xué)技術(shù)計算機(jī)/網(wǎng)絡(luò)認(rèn)證與等級考試全國計算機(jī)應(yīng)用技術(shù)(NIT)Java學(xué)習(xí)筆記:從入門到實戰(zhàn)

Java學(xué)習(xí)筆記:從入門到實戰(zhàn)

Java學(xué)習(xí)筆記:從入門到實戰(zhàn)

定 價:¥59.80

作 者: 張曉博
出版社: 中國鐵道出版社
叢編項:
標(biāo) 簽: 暫缺

ISBN: 9787113261436 出版時間: 2019-10-01 包裝:
開本: 16開 頁數(shù): 424 字?jǐn)?shù):  

內(nèi)容簡介

  本書通過學(xué)習(xí)筆記的形式,以嵌入式小示例和項目實踐案例的形式,主要講解Java開發(fā)環(huán)境搭建、Java程序要素、對象以及方法、Java常用類庫以及異常的捕獲與處理等;除此之外,對多線程、文件I/O操作、GUI編程、數(shù)據(jù)庫編程、Java Web、常用設(shè)計框架以及Android編程基礎(chǔ)等進(jìn)行了翔實闡述。

作者簡介

  張曉博 :浪潮軟件研發(fā)工程師,開發(fā)經(jīng)驗豐富,為國內(nèi)知名**集團(tuán)、電子政務(wù)、稅務(wù)系統(tǒng)、質(zhì)監(jiān)系統(tǒng)、藥監(jiān)系統(tǒng)、公安系統(tǒng)、系統(tǒng)集成等領(lǐng)域提供了綜合解決方案?,F(xiàn)在就職于IBM和浪潮合作成立的“SOA技術(shù)實驗室”。參與編寫暢銷書籍《21天學(xué)通Java》和《21天學(xué)通Java Web開發(fā)》。

圖書目錄

第1 章 Java 語言基礎(chǔ)
1.1 Java 語言介紹 ....................................................................................................1
1.1.1 Java 語言的發(fā)展歷程 .........................................................................................1
1.1.2 Java 語言的體系 .................................................................................................2
1.1.3 Java 語言的特點 .................................................................................................2
1.1.4 Java 語言的地位 .................................................................................................3
1.2 搭建Java 開發(fā)環(huán)境 ...........................................................................................3
1.2.1 安裝JDK .............................................................................................................3
1.2.2 在Windows 7 配置Java 環(huán)境 ............................................................................6
1.2.3 在Windows 10 配置Java 環(huán)境 ..........................................................................6
1.2.4 充分利用Java API 文檔 .....................................................................................8
1.3 個Java 程序 ...............................................................................................9
1.3.1 編寫個Java 代碼 ........................................................................................9
實例1-1:個Java 程序代碼 ................................................................................................ 9
1.3.2 編譯Java 程序 ....................................................................................................9
1.3.3 運(yùn)行Java 代碼 ..................................................................................................10
1.3.4 Java 11 新特性:新的程序運(yùn)行方式 .............................................................11
第2章 使用IDE 開發(fā)工具
2.1 使用Eclipse .....................................................................................................12
2.1.1 IDE 介紹 ...........................................................................................................12
2.1.2 下載并安裝Eclipse ..........................................................................................12
2.1.3 新建一個Eclipse 項目 .....................................................................................16
2.1.4 編譯并運(yùn)行Eclipse 項目 .................................................................................17
2.1.5 使用Eclipse 打開一個Java 工程——打開下載包中的項目 ........................18
2.2 使用Intellij IDEA ............................................................................................19
2.2.1 搭建IntelliJ IDEA 開發(fā)環(huán)境 ...........................................................................19
2.2.2 使用IntelliJ IDEA 新建Java 工程 ..................................................................21
2.2.3 使用IntelliJ IDEA 運(yùn)行Java 程序 ..................................................................22
第3 章 Java 基礎(chǔ)語法
3.1 關(guān)鍵字、標(biāo)識符和注釋 ..................................................................................23
3.1.1 關(guān)鍵字 ...............................................................................................................23
3.1.2 標(biāo)識符 ...............................................................................................................24
3.1.3 注釋 ...................................................................................................................24
3.2 變量和常量 ......................................................................................................25
3.2.1 常量 ...................................................................................................................25
實例3-1:定義幾個Java 常量 .................................................................................................. 25
3.2.2 變量 ...................................................................................................................26
實例3-2:計算三角形、正方形和長方形的面積 ................................................................... 27
實例3-3:輸出各種變量的值 ................................................................................................... 27
3.3 數(shù)據(jù)類型 ..........................................................................................................28
3.3.1 為什么引入數(shù)據(jù)類型 .......................................................................................29
3.3.2 基本數(shù)據(jù)類型的取值范圍 ...............................................................................29
3.3.3 字符型 ...............................................................................................................30
實例3-4:輸出三種特殊符號 ................................................................................................... 30
3.3.4 整型 ...................................................................................................................31
實例3-5:通過整型類型計算圖形周長和面積 ....................................................................... 31
3.3.5 浮點型 ...............................................................................................................32
實例3-6:計算圓的面積 ........................................................................................................... 33
3.3.6 布爾型 ...............................................................................................................33
實例3-7:比較兩個數(shù)的大小 ................................................................................................... 33
3.4 運(yùn)算符 ..............................................................................................................34
3.4.1 算術(shù)運(yùn)算符 .......................................................................................................34
實例3-8:基本的數(shù)學(xué)運(yùn)算(加、減、乘、除) ................................................................... 34
實例3-9:使用“%”運(yùn)算符 .................................................................................................... 35
實例3-10:使用遞增與遞減運(yùn)算符 ......................................................................................... 36
3.4.2 關(guān)系運(yùn)算符和邏輯運(yùn)算符 ...............................................................................36
實例3-11:使用關(guān)系運(yùn)算符比較數(shù)字和字符 ......................................................................... 37
3.4.3 位運(yùn)算符 ...........................................................................................................38
實例3-12:對兩個整數(shù)實現(xiàn)位運(yùn)算 ......................................................................................... 39
3.4.4 條件運(yùn)算符 .......................................................................................................39
實例3-13:使用條件運(yùn)算符判斷成績是否優(yōu)秀 ..................................................................... 39
3.4.5 賦值運(yùn)算符 .......................................................................................................40
實例3-14:賦值類型不匹配的錯誤 ......................................................................................... 40
3.4.6 運(yùn)算符的優(yōu)先級 ...............................................................................................40
實例3-15:四則混合運(yùn)算 ......................................................................................................... 41
3.5 類型轉(zhuǎn)換 ..........................................................................................................42
3.5.1 自動類型轉(zhuǎn)換 ...................................................................................................42
實例3-16:將整數(shù)自動轉(zhuǎn)換為fl oat 類型 ................................................................................ 42
3.5.2 強(qiáng)制轉(zhuǎn)換 ...........................................................................................................43
實例3-17:實現(xiàn)int、byte 和double 類型之間的強(qiáng)制轉(zhuǎn)換 ................................................... 43
第4 章 使用條件語句
4.1 使用if 語句 ......................................................................................................44
4.1.1 if 語句介紹 ........................................................................................................44
實例4-1:判斷成績是否及格 ................................................................................................... 45
4.1.2 if 語句的延伸 ....................................................................................................45
實例4-2:對兩種條件給出不同的答案 ................................................................................... 46
4.1.3 多個條件判斷的if 語句 ...................................................................................46
實例4-3:模擬抽獎系統(tǒng) ........................................................................................................... 47
4.2 使用switch 語句 ..............................................................................................47
4.2.1 switch 語句基礎(chǔ) ................................................................................................48
實例4-4:判斷數(shù)字的大小 ....................................................................................................... 48
4.2.2 沒有break 時的情形 ........................................................................................49
實例4-5:執(zhí)行switch 后面的所有分支條件語句 ................................................................... 49
4.2.3 case 沒有執(zhí)行語句 ...........................................................................................49
實例4-6:在case 語句后沒有執(zhí)行的代碼 .............................................................................. 50
4.2.4 default 可以不在末尾 .......................................................................................50
實例4-7:將default 放在個case 分支中 ......................................................................... 50
第5 章 使用循環(huán)語句
5.1 使用for 循環(huán)語句 ............................................................................................51
5.1.1 for 循環(huán)介紹 .....................................................................................................51
實例5-1:輸出整數(shù)0 到9 ........................................................................................................ 52
5.1.2 嵌套使用for 循環(huán) ............................................................................................52
實例5-2:使用嵌套for 語句顯示人民幣符號和美元符號 ..................................................... 53
實例5-3:在屏幕中輸出一個用“*”擺放的菱形 ................................................................. 53
5.2 使用while 循環(huán)語句 .......................................................................................54
5.2.1 while 循環(huán)基礎(chǔ) .................................................................................................54
實例5-4:循環(huán)輸出18 個數(shù)字 ................................................................................................. 54
實例5-5:輸出能夠整除7 的數(shù)字 ........................................................................................... 55
5.2.2 do-while 循環(huán)語句 ............................................................................................55
實例5-6:使用do-while 語句輸出0 到7 ................................................................................ 56
實例5-7:計算1 2 3 …. 100 的和 ....................................................................................... 56
5.3 使用跳轉(zhuǎn)語句 ..................................................................................................57
5.3.1 break 語句 .........................................................................................................57
實例5-8:使用break 終止循環(huán)的執(zhí)行 .................................................................................... 57
實例5-9:在while 循環(huán)語句中使用break............................................................................... 57
實例5-10:使用有標(biāo)號的break 語句 ...................................................................................... 58
5.3.2 使用return 語句 ...............................................................................................59
實例5-11:使用return 語句結(jié)束循環(huán)的執(zhí)行 .......................................................................... 59
5.3.3 使用continue 跳轉(zhuǎn)語句 ...................................................................................59
實例5-12:使用continue 改變for 循環(huán)的運(yùn)行結(jié)果 ............................................................... 59
第6 章 操作字符串
6.1 Java 字符串的初始化 ......................................................................................61
實例6-1:實現(xiàn)Java 字符串的初始化 ...................................................................................... 61
6.2 使用String 類操作字符串 ..............................................................................62
6.2.1 獲取指定索引位置的字符 ...............................................................................62
實例6-2:返回某個字符串指定索引的字符 ........................................................................... 62
6.2.2 追加字符串 .......................................................................................................63
實例6-3:在字符串后面追加字符串(好好 學(xué)習(xí)) ........................................................... 63
6.2.3 連接多個字符串 ...............................................................................................63
實例6-4:使用“ ”連接兩個對象 ......................................................................................... 63
6.2.4 比較字符串 .......................................................................................................63
實例6-5:判斷兩個指定的字符串是否相等 ........................................................................... 64
6.2.5 獲得字符串長度 ...............................................................................................64
實例6-6:獲取字符串的長度 ................................................................................................... 64
6.2.6 替換字符串 .......................................................................................................65
實例6-7:替換字符串中的某一個文字 ................................................................................... 65
6.2.7 截取字符串 .......................................................................................................65
實例6-8:截取一個字符串,并輸出截取后的結(jié)果 ............................................................... 65
6.2.8 字符串的大小寫互轉(zhuǎn) .......................................................................................66
實例6-9:對指定的字符串實現(xiàn)大小寫轉(zhuǎn)換 ........................................................................... 66
6.2.9 消除字符串中的空白字符 ...............................................................................66
實例6-10:去掉字符串開頭的空白字符 ................................................................................. 66
6.2.10 查找字符串 .....................................................................................................67
實例6-11:查找字符串str 中空字符的位置 ........................................................................... 68
6.3 使用類StringBuffer ........................................................................................68
實例6-12:使用追加字符函數(shù) ................................................................................................. 69
第7 章 使用數(shù)組
7.1 簡單的一維數(shù)組 ..........................................................................................70
7.1.1 聲明一維數(shù)組 ...................................................................................................70
7.1.2 創(chuàng)建一維數(shù)組 ...................................................................................................70
實例7-1:創(chuàng)建并輸出一維數(shù)組中的數(shù)據(jù) ............................................................................... 71
7.1.3 初始化一維數(shù)組 ...............................................................................................72
實例7-2:初始化一維數(shù)組,并將數(shù)組值輸出打印 ............................................................... 72
7.2 二維數(shù)組 ..........................................................................................................73
7.2.1 聲明二維數(shù)組 ...................................................................................................73
7.2.2 創(chuàng)建二維數(shù)組 ...................................................................................................73
實例7-3:創(chuàng)建二維數(shù)組并輸出打印里面的數(shù)據(jù) ................................................................... 74
7.2.3 初始化二維數(shù)組 ...............................................................................................74
實例7-4:打印輸出二維數(shù)組中的數(shù)據(jù) ................................................................................... 75
7.3 三維數(shù)組 ..........................................................................................................76
7.3.1 聲明三維數(shù)組 ...................................................................................................76
7.3.2 初始化三維數(shù)組 ...............................................................................................76
實例7-5:創(chuàng)建三維數(shù)組,然后輸出打印數(shù)組內(nèi)元素 ........................................................... 77
7.4 操作數(shù)組 ..........................................................................................................77
7.4.1 復(fù)制數(shù)組 ...........................................................................................................78
實例7-6:復(fù)制一維數(shù)組中的元素 ........................................................................................... 78
7.4.2 比較數(shù)組 ...........................................................................................................79
實例7-7:比較兩個一維數(shù)組 ................................................................................................... 79
7.4.3 搜索數(shù)組中的元素 ...........................................................................................79
實例7-8:使用binarySearch() 搜索數(shù)組內(nèi)元素...................................................................... 79
7.4.4 排序數(shù)組 ...........................................................................................................80
實例7-9:使用sort() 排序數(shù)組內(nèi)元素 ..................................................................................... 80
7.4.5 填充數(shù)組 ...........................................................................................................80
實例7-10:使用fi ll() 向數(shù)組中添加新的元素 ........................................................................ 80
7.5 數(shù)組的高級用法 ..............................................................................................81
7.5.1 動態(tài)數(shù)組 ...........................................................................................................81
實例7-11:將ArrayList 作為Java 動態(tài)數(shù)組 ........................................................................... 82
7.5.2 使用foreach 循環(huán) .............................................................................................82
實例7-12:使用foreach 遍歷輸出數(shù)組中的元素 ................................................................... 83
7.5.3 數(shù)組和內(nèi)存 .......................................................................................................83
實例7-13:初始化基本類型數(shù)組 ............................................................................................. 84

本目錄推薦

掃描二維碼
Copyright ? 讀書網(wǎng) ranfinancial.com 2005-2020, All Rights Reserved.
鄂ICP備15019699號 鄂公網(wǎng)安備 42010302001612號