Sring
類的方法,能夠對字符進行檢索、判斷和加工,是很是實用的一種。java.lang
中的類,其餘的類都須要import
聲明來引用和指定。a*a*a*a*a*a*a*a*.....
,更不用說如何取平方根了,看到Math類實在是一個驚喜。if-else
語句使用50行作出而沾沾自喜,emmmm.....本週教材中無重大問題。html
問題2:pp3.3題目中通過屢次調試仍是出現了錯誤,自認爲沒有差錯,卻一籌莫展。(出現瞭如圖中倒數第四排的錯誤)java
問題2解決方案:老師路過的時候發現了程序中的一個致命問題,表示條件之「與」,應使用&&
,而不是個人錯誤作法||
(或),現學現賣的仍是不可靠。git
(statistics.sh腳本的運行結果截圖)安全
錯題1: Consider the following statement:
System.out.println("1 big bad wolf\t8 the 3 little pigs\n4 dinner\r2night");
This statement will output ________ lines of text (思考下面的語句,該語句將輸出___行文本)
緣由:誤覺得\t
能夠換行。事實上並不行。數據結構
錯題2:What value will z have if we execute the following assignment statement? float z = 5 / 10; (若是咱們執行下面的賦值語句,獲得的z將會是什麼值?)
緣由:5和10都是int
值,5/10結果爲0而不是使用float
值進行計算。dom
錯題3:If x is an int and y is a float, all of the following are legal except which assignment statement? (若是x是一個int類型的數,y是一個float類型的數,下面全部賦值語句中哪一個不合法?) 答案爲:B .x = y;
緣由:誤覺得是強制轉換的形式,結果格式並不對。ide
錯題4: What is output with the statement System.out.println(""+x+y); if x and y are int values where x=10 and y=5? (若是x和y是int類型的數值,x=10,y=5,那麼語句System.out.println(""+x+y);的輸出是什麼?)
緣由:從左至右執行時,因爲存在""
,+
起到拼接做用而不是相加。學習
錯題5:Java is a strongly typed language. What is meant by "strongly typed"? (Java是一種強類型語言。「強類型」指的是什麼?)
緣由:在程序中,每一個變量都有一個與之關聯的類型,而變量只能存儲該類型的值。設計
錯題6:A variable of type boolean will store either a 0 or a 1. (Boolean類型的變量將被存儲爲0或1)
緣由:儲存爲true
&false
。3d
錯題7:The values of (double) 5 / 2 and (double) (5 / 2) are identical. ((double) 5 / 2和(double) (5 / 2)的值是相同的。)
緣由:同錯題2 ↑
代碼行數(新增/累積) | 博客量(新增/累積) | 學習時間(新增/累積) | 重要成長 | |
---|---|---|---|---|
目標 | 5000行 | 30篇 | 400小時 | |
第一週 | 195/195 | 1/4 | 20/20 | 對代碼產生了很大興趣 |
第二週 | 309/504 | 1/5 | 20/40 | 打字速度明顯提高 |
第三週 | 311/815 | 2/7 | 25/65 | 無 |
第四周 |