所謂「實踐是檢驗認識真理性的惟一標準」,我在IntelliJ IDEA上把教材第三章課後練習題又敲了一
遍,給出了本身的答案,並加上了一些本身的分析,經過逐題進行代碼調試實踐的方式來深刻對java類與對象的理解。小白在此懇請你們積極指出錯誤的地方(>_<)html
A
分析:java
import java.util.*; class Student9415 { String number; String name; int score; Student9415(String number, String name, int score) { this.number = number; this.name = name; this.score = score; } } public class Exercise9415 { public static void main(String[] args) { Set<Student9415> students = new HashSet<>(); students.add(new Student9415("B1234", "Justin", 90)); students.add(new Student9415("B5678", "Monica", 100)); students.add(new Student9415("B1234", "Justin", 100)); students.add(new Student9415("B5678", "Monica", 98)); students.add(new Student9415("B5678", "Monica", 100)); System.out.println(students.size()); } }
BC 分析:git
import java.util.*; public class Exercise9416 { public static void main(String[] args) { Set<Integer> numbers = new TreeSet<>(); numbers.add(1); numbers.add(2); numbers.add(1); numbers.add(3); foreach(numbers); } private static void foreach(Collection<Integer> numbers) { for(Integer number : numbers) { System.out.println(number); } } }
ABD
錯選:AD
分析:
正則表達式
succeeded screenshot:算法
one example:
another example:
編程
(statistics.sh腳本的運行結果截圖)數組
本週依然採用在藍墨雲班課上考試的形式,在25分鐘的時間裏須要做答26道選擇題,並且還有很多多選題,甚至大多都是程序分析題,一道一道敲到電腦上再去運行確定是來不及的(>_<),更要命的是不少題不去跑程序的話我根本無從下手(>o<)因此仍是老老實實學紮實纔是萬全之策啊~網絡
正確答案: A D
你的答案: A
分析:要成功複製目錄須要加上 -r 或者 -R 參數,表示遞歸複製數據結構
正確答案: B C
你的答案: D
分析:反向引用 \1 表明第一個()中的匹配內容ide
正確答案: ABCD
個人答案: A C
分析:* 能夠是0次
Suppose we have an array of String objects identified by the variable names. Which of the following for loops will not correctly process each element in the array.(假如咱們有一個名爲names的String對象數組,下面哪一個for循環不能遍歷數組中的每個元素?)
正確答案: C
個人答案: E
分析:Choice c will not process each element correctly due to a syntax error. The length variable is not a method and, therefore, does not have parenthesis after it. Choice b is an example of using a foreach loop to process an array, and choice a is a correct for loop.
Which of the statements is true about the following code snippet?(對於下面的代碼段,說法正確的是?)
int[] array = new int[25]; array[25] = 2;
A .The integer value 2 will be assigned to the last index in the array.(整數2會賦給數組中最後一個元素)
B .The integer value 25 will be assigned to the second index in the array.(整數25會賦給數組中的第2個索引)
C .The integer value 25 will be assigned to the third value in the array. (整數25會賦給數組中的第3個元素)
D .This code will result in a compile-time error.(代碼會產生編譯時錯誤)
E .This code will result in a run-time error. (代碼會產生運行時錯誤)
正確答案: E
個人答案: A
分析:This code will throw an ArrayIndexOutOfBoundsException, since the last index in this array will be 24. This causes a run-time error.
教材學習中的問題和解決過程, 一個問題加1分
代碼調試中的問題和解決過程, 一個問題加1分
基於評分標準,我給本博客打分:XX分。得分狀況以下:xxx
唉,今天是我心愛♥的macbook進水一週記念日QwQ,回想起一週前的那晚仍是心有餘悸、難以釋懷……在這沒有mac的一週時光裏,我居然苟延殘喘地依賴着別人家的電腦奇蹟般地活了過來而且奇蹟般地貌似順利完成了全部學習任務QwQ在此必需要點名感謝一波20155332盛照宗同窗的雪中送炭無償提供他的lenovo來供我學習以及20145320周岐浩學長在週三java當堂考試時慷慨地借出他鐘愛的筆記本電腦~不過話說回來用了一週照宗同窗的電腦讓我着實體會了一波之前從未體驗過的Windows10系統,還算比較順手耶,這很大程度上消除了一直以來win10給我各方面都不太好的印象( •̀ ω •́ )y誰再說win10辣雞我可要打他了啊ε=( o`ω′)ノ不過不管如何我也擺脫不了對mac的思念♥♥坐等五一回家保修ing......。┭┮﹏┭┮。
代碼行數(新增/累積) | 博客量(新增/累積) | 學習時間(新增/累積) | 重要成長 | |
---|---|---|---|---|
目標 | 5000行 | 20篇 | 300小時 | |
第一週 | 34/34 | 1/4 | 12/12 | |
第二週 | 360/394 | 1/5 | 16/28 | |
第三週 | 701/1018 | 1/6 | 19/ 47 | 代碼量激增( ̀⌄ ́) |
第四周 | 608/1375 | 1/7 | 18/55 | ①蹭了一節張健毅老師的Java課;②本身將數據結構課上所學的排序算法除了基數排序以外所有用C語言實現了一遍(`_´)ゞ;③本次博客前所未有的長:) |
第五週 | 1205/2580 | 1/8 | 9/64 | 蹭了一節張健毅老師的Java課 |
第六週 | 826/3339 | 1/9 | 8/72 | |
第七週 | 3119/6476 | 2/11 | 13/85 | ①蹭了一節張健毅老師的Java課;②在寫了無數篇實驗報告以後還寫了兩篇博客!! |
第八週 | / | 1/12 | 10/95 | |
第九周 | / | 2/14 | 12/107 | 本週又寫了兩篇博客! |
第十週 | / | 1/15 | 8/115 |
計劃學習時間:10小時
實際學習時間:8小時