国产午夜成人免费看片无遮挡_日本免费xxxx色视频_免费人成网上在线观看_黄网址在线永久免费观看

當前位置:雨林木風下載站 > 技術開發教程 > 詳細頁面

SCJP考題中的陷阱

SCJP考題中的陷阱

更新時間:2022-05-08 文章作者:未知 信息來源:網絡 閱讀次數:

最近在網上閑逛時偶然發現此文章,基本上指出了SCJP的出題陷阱,讀過后覺得其列的還比較詳細,故貼與此,希望能對打算考SCJP的朋友有一些幫助.此文雖是E文,但句法簡單,很容易理解,而且我在大部分后面加了一些注釋"()",對新手可能會有幫助.
 SCJP考題中的陷阱
原著 Ajith Kallambella


(1) Two public classes in the same file. (illegal)

(2) Main method calling a non-static method. (illegal)

(3) Methods with the same name as the constructor(s). (這種題常有)

(4) Thread initiation with classes that do not have a run() method. (常考之題)

(5) Local inner classes trying to access non-final vars. (illegal)

(6) Case statements with values out of permissible range. (byte,int, short, chat)

(7) Math class being an option for immutable classes !! (totally wrong!)

(8) instanceOf is not same as instanceof.

(9) Private constructors. (legal)

(10) An assignment statement which looks like a comparison. (比如說if(a=true),對于這種題眼睛亮一點)

(11) System.exit() in try-catch-finally blocks. (finally 不會執行)

(12) Order of try-catch-finally blocks matters. (若順序錯的話: error: No try before catch)

(13) main() can be declared final. (OK)

(14) -0.0 == 0.0 is true.

(15) A class without abstract methods can still be declared abstract.

(16) RandomAccessFile descends from Object and implements DataInput and DataOutput.

(17) Map does not implement Collection.

(18) Dictionary is a class, not an interface.

(19) Collection is an Interface where as Collections is a helper class. (這題我倒沒見過,但還真容易看混)

(20) Class declarations can come in any order.
(也就是說: class Child extends Parents{}
 class Parents{}
 這種順序是可以的.)

(21) Forward references to variables gives compiler error.

(22) Multi dimensional arrays can be sparce.
(這句話是說: 多維數組中子數組不一定必須有一定個數的元素,比如我們把一個二維數組看成一個矩陣,那么行與列中的元素可以不完整,可以不對齊.)

(23) Arrays, whether local or class-level, are always initialized.

(24) Strings are initialized to null, not empty string.

(25) An empty string is NOT the same as a null string.

(26) A declaration cannot be labelled.

(27) "continue" must be in a loop(for, do, while). It cannot appear in case constructs.

(28) Primitive array types can never be assigned to each other, eventhough the primitives themselves can be assigned.
(也就是說: ArrayofLongPrimitives = ArrayofIntegerPrimitives 會編譯出錯,但 longvar = intvar 是合法的)

(29) A constructor can throw any exception.

(30) Initilializer blocks are executed in the order of declaration.

(31) Instance initializer(s) gets executed ONLY IF the objects are constructed.

(32) All comparisons involving NaN and a non-Nan would always result false. (對大多數朋友來說這可是個盲點噢)

(33) Default type of a numeric literal with a decimal point is double.
(我在這里把Java成員變量默認初始化原則寫一下:
 成員變量類型取值
 byte0
 short 0
 int 0
 long0L
 char'\u0000'
 float 0.0F
 double0.0D
 boolean false
 所有引用類型 null)

(34) integer (and long ) operations / and % can throw ArithmeticException while float / and % will never, even in case of division by zero.

(35) == gives compiler error if the operands are cast-incompatible.

(36) You can never cast objects of sibling classes( sharing the same parent ), even with an explicit cast.

(37) .equals returns false if the object types are different.It does not raise a compiler error.

(38) No inner class can have a static member.(but static inner class can)

(39) File class has NO methods to deal with the contents of the file.(also the existing directory)

(40) InputStream and OutputStream are abstract classes, while DataInput and DataOutput are interfaces.


當然以上這些都是從題目中總結出來的技巧,其實書上也都有,大家還是多看看書噢.


真不錯。。。早點出來就好了。。。呵呵。。。偶幫忙翻譯一下。。。
有 “(請提意見)” 的,大家討論一下。謝謝
(1) Two public classes in the same file. (illegal)
 同一個文件里有兩個public類。(非法)

(2) Main method calling a non-static method. (illegal)
 在main(String[] args)方法內調用一個非靜態方法。(非法)

(3) Methods with the same name as the constructor(s). (這種題常有)
 與Constructor(s)有相同名字的方法。

(4) Thread initiation with classes that do not have a run() method. (常考之題)
 初始化了一個沒有run()方法的線程類。

(5) Local inner classes trying to access non-final vars. (illegal)
 內部類嘗試訪問非final變量(非法)

(6) Case statements with values out of permissible range. (byte,int, short, chat)
 選擇語句case中,沒有使用允許的值。如(byte,int,short,char)等

(7) Math class being an option for immutable classes !! (totally wrong!)
 Math類作為不可改變類。(完全錯誤) (請提意見)

(8) instanceOf is not same as instanceof.
 instanceOf 不是 instanceof。

(9) Private constructors. (legal)
 私有 的Constructor。 (合法)

(10) An assignment statement which looks like a comparison.
一個 賦值語句 看起來像 比較語句。
比如說if(a=true),和if(a==true)。對于這種題眼睛亮一點。

(11) System.exit() in try-catch-finally blocks. (finally 不會執行)
在try-catch-final塊中的退出語句。 (finally不會執行)

(12) Order of try-catch-finally blocks matters. (若順序錯的話: error: No try before catch)
try-catch-final塊的順序問題。

(13) main() can be declared final. (OK)
main()方法 可以聲明為 final.

(14) -0.0 == 0.0 is true.
如題。

(15) A class without abstract methods can still be declared abstract
沒有 抽象方法的類,仍然可以定義為抽象類。

(16) RandomAccessFile descends from Object and implements DataInput and DataOutput.
RandomAccessFile 類繼承Object,并且實現了DataInput和DataOutput接口。

(17) Map does not implement Collection.
Map 并不實現 Collection.

(18) Dictionary is a class, not an interface.
Dictionary 是一個類,不是接口。

(19) Collection is an Interface where as Collections is a helper class. (這題我倒沒見過,但還真容易看混)
Collection是一個接口,但 Collections卻是一個輔助類。

(20) Class declarations can come in any order.
 (也就是說: class Child extends Parents{}
class Parents{}
這種順序是可以的.)
可以以任何順序申明類。

(21) Forward references to variables gives compiler error.
把 reference 給 變量,會產生編譯錯誤。 (請提意見)

(22) Multi dimensional arrays can be sparce.
(這句話是說: 多維數組中子數組不一定必須有一定個數的元素,比如我們把一個二維數組看成一個矩陣,那么行與列中的元素可以不完整,可以不對齊.)
如jiayuan所說。

(23) Arrays, whether local or class-level, are always initialized.
數組,無論是當前的,還是類等級的,都會被初始化。

(24) Strings are initialized to null, not empty string.
String 是被初始化為 null,不是空字符。

(25) An empty string is NOT the same as a null string.
一個空字符串 不是 一個null字符。

(26) A declaration cannot be labelled.
一個聲明語句不能被標記。

(27) "continue" must be in a loop(for, do, while). It cannot appear in case constructs.
“continue”已經要在一個循環里(如for,do,while),它不能在case語句中出現。

(28) Primitive array types can never be assigned to each other, eventhough the primitives themselves can be assigned.
 (也就是說: ArrayofLongPrimitives = ArrayofIntegerPrimitives 會編譯出錯,
但 longvar = intvar 是合法的)

 Primitive(int,char,long等)數組是不能互相賦值的,即使它們本身可以。
 解釋見jiayuan所說。

(29) A constructor can throw any exception.
一個Constructor可以拋出任何異常。

(30) Initilializer blocks are executed in the order of declaration.
初始化塊是按照聲明的順序執行的。(請提意見)

(31) Instance initializer(s) gets executed ONLY IF the objects are constructed.
實例初始化語句塊只有在它建立后才會被執行。

(32) All comparisons involving NaN and a non-Nan would always result false. (對大多數朋友來說這可是個盲點噢)
所有關于 NaN(Not a Number) 和 non-NaN 的比較,都返回false.
這條很重要。

(33) Default type of a numeric literal with a decimal point is double.
我在這里把Java成員變量默認初始化原則寫一下:
 成員變量類型取值
byte0
 short 0
 int 0
 long0L
 char'\u0000'
 float 0.0F
 double0.0D
 boolean false
 所有引用類型null

(34) integer (and long ) operations / and % can throw ArithmeticException while float / and % will never, even in case of division by zero.
integer和long 操作 /和% 的話, 會拋出ArithmeticException,
 但是 float形不會,即使是除以0。

(35) == gives compiler error if the operands are cast-incompatible.
==會產生編譯錯誤,如果兩邊 不兼容的話。

(36) You can never cast objects of sibling classes( sharing the same parent ), even with an explicit cast.
 你永遠不可能 轉化具有同一個超類的類的對象,即使是刻意轉化。(請提意見)

(37) .equals returns false if the object types are different.It does not raise a compiler error.
equals() 返回 false 如果對象類型不同,但不產生 編譯錯誤。

(38) No inner class can have a static member.(but static inner class can)
沒有內部類 可以擁有 靜態成員。(但靜態內部類可以)

(39) File class has NO methods to deal with the contents of the file.(also the existing directory)
File類沒有 任何 處理文件內容的方法。(當然,存在的目錄也一樣)

(40) InputStream and OutputStream are abstract classes, while DataInput and DataOutput are interfaces.
InputStream 和 OutputStream 是 抽象類,
 但是 DataInput 和 DataOutput是 接口。

當然以上這些都是從題目中總結出來的技巧,其實書上也都有,大家還是多看看書噢.

溫馨提示:喜歡本站的話,請收藏一下本站!

本類教程下載

系統下載排行

国产午夜成人免费看片无遮挡_日本免费xxxx色视频_免费人成网上在线观看_黄网址在线永久免费观看

  • <label id="pxtpz"><meter id="pxtpz"></meter></label>
      1. <span id="pxtpz"><optgroup id="pxtpz"></optgroup></span>

        日韩欧美第一区| 精品成a人在线观看| 91精品久久久久久蜜臀| 丁香激情综合五月| 欧美人xxxx| 国产欧美视频一区二区三区| 美女视频网站久久| 美女视频网站久久| 日韩精品视频网站| 欧美日韩性生活| 亚洲.国产.中文慕字在线| 91精彩视频在线观看| 亚洲丝袜精品丝袜在线| 色天使色偷偷av一区二区| 中文字幕制服丝袜成人av| 成人不卡免费av| 亚洲一区在线观看视频| 91精品国产高清一区二区三区蜜臀 | 欧美伊人精品成人久久综合97| 欧美国产国产综合| 欧美探花视频资源| 久久99精品久久久久婷婷| 日本一区二区三区国色天香| 色婷婷综合久久久中文一区二区| 午夜成人免费视频| 日本一区二区三区dvd视频在线| 色婷婷久久久综合中文字幕 | 色悠悠亚洲一区二区| 久久成人精品无人区| 亚洲精品亚洲人成人网 | 一区二区三区在线观看欧美| 91黄视频在线观看| 91免费看`日韩一区二区| 亚洲国产精品二十页| 2023国产精华国产精品| 中文字幕一区在线观看视频| 中文字幕欧美日韩一区| 欧美不卡在线视频| 国产精品私人自拍| 亚洲va天堂va国产va久| 美国十次综合导航| 亚洲国产成人av| 欧美日韩在线播放| 成人动漫视频在线| 国产91综合一区在线观看| 极品少妇xxxx精品少妇| 男人的j进女人的j一区| 亚洲va国产va欧美va观看| 亚洲国产人成综合网站| 亚洲人妖av一区二区| 亚洲精品福利视频网站| 视频一区二区三区中文字幕| 久草在线在线精品观看| 国产不卡一区视频| 欧美亚洲一区三区| 久久日一线二线三线suv| 欧美国产在线观看| 亚洲观看高清完整版在线观看 | 一本高清dvd不卡在线观看| 欧美午夜在线观看| 久久久久久夜精品精品免费| 国产精品久久久久影院亚瑟| 欧美性大战久久| 91福利资源站| 狠狠狠色丁香婷婷综合久久五月| 国产日产欧美一区二区三区| bt欧美亚洲午夜电影天堂| 国产精品国产三级国产普通话三级 | 一本大道综合伊人精品热热 | 欧美日韩久久久| 91麻豆精品国产91久久久久| 亚洲精品在线三区| 亚洲精品一二三四区| 全国精品久久少妇| 国产suv精品一区二区三区| 欧美视频日韩视频在线观看| 国产午夜精品一区二区三区视频| 亚洲欧美国产毛片在线| 国产在线国偷精品产拍免费yy| 日本电影欧美片| 1024成人网色www| 久草在线在线精品观看| 欧美男男青年gay1069videost| 亚洲国产高清在线观看视频| 国产一区二区久久| 久久久99精品久久| 99国产欧美另类久久久精品| 欧美草草影院在线视频| 麻豆精品蜜桃视频网站| 日韩精品中文字幕一区| 久久电影网站中文字幕| 久久精品夜色噜噜亚洲aⅴ| 国产精品91一区二区| 中文字幕av一区二区三区| 国产成人精品三级麻豆| 亚洲人成在线播放网站岛国| 91福利国产成人精品照片| 亚洲444eee在线观看| 久久先锋影音av| 色综合久久中文字幕综合网| 亚洲成av人片在线观看| 4438x亚洲最大成人网| 麻豆精品视频在线观看视频| 国产亚洲精品免费| 99久久国产综合精品女不卡| 亚洲综合在线电影| 6080午夜不卡| 国产99一区视频免费| 最新久久zyz资源站| 欧美日韩精品一区二区在线播放| 免费观看91视频大全| 国产精品久久久久久久久果冻传媒| eeuss国产一区二区三区| 夜夜夜精品看看| 国产欧美一区二区精品忘忧草| 色综合激情久久| 精品无码三级在线观看视频| 国产欧美日本一区视频| 91女人视频在线观看| 国产成人综合在线观看| 一区二区三区国产| 欧美国产日韩在线观看| 日韩欧美成人午夜| 911国产精品| 久久久精品人体av艺术| 91欧美一区二区| 成人免费黄色在线| 国产麻豆91精品| 久久精品国产99国产| 午夜精品久久久久影视| 亚洲男人都懂的| 亚洲欧美日本在线| 成人免费小视频| 亚洲日本在线看| 亚洲黄一区二区三区| 精品视频免费在线| 99国产麻豆精品| 国产精品久久久久9999吃药| 国产精品久99| 日韩和欧美的一区| 成人深夜福利app| 91麻豆精品国产| 亚洲乱码国产乱码精品精可以看 | 国产乱人伦偷精品视频不卡 | 久久国产精品第一页| 国产在线精品一区在线观看麻豆| 粉嫩aⅴ一区二区三区四区| 欧洲一区二区三区在线| 884aa四虎影成人精品一区| 中文字幕欧美一区| 亚洲福利国产精品| thepron国产精品| 日韩视频一区二区三区在线播放| 亚洲欧美二区三区| 91久久精品日日躁夜夜躁欧美| 国产精品蜜臀av| 成人avav影音| 亚洲欧洲一区二区在线播放| 成人蜜臀av电影| 国产精品麻豆一区二区| 国产福利精品导航| 亚洲色大成网站www久久九九| 激情五月婷婷综合网| 精品国产乱码久久久久久蜜臀| 亚洲国产va精品久久久不卡综合| 精品国内片67194| 狠狠色狠狠色合久久伊人| 欧美成人女星排名| 卡一卡二国产精品| 精品国产一区二区精华| 美脚の诱脚舐め脚责91 | 欧美一级黄色片| 日韩电影在线观看电影| 日韩精品一区二区在线观看| 国产激情视频一区二区三区欧美| 国产日产欧美一区二区三区| 欧美日韩视频第一区| 国产一区二区不卡| 亚洲图片欧美一区| 3d成人动漫网站| 国产精品亚洲а∨天堂免在线| 久久久噜噜噜久久中文字幕色伊伊| 久久国产综合精品| 日韩欧美国产1| 99国产精品久久久久久久久久久| 亚洲成av人**亚洲成av**| 日韩一级视频免费观看在线| 国产盗摄一区二区| 亚洲精品写真福利| 精品粉嫩aⅴ一区二区三区四区| 亚洲欧洲韩国日本视频| 日韩欧美亚洲国产另类| 欧美三区在线观看| 国产亚洲精品资源在线26u| 日本黄色一区二区| 国产精品一区二区视频| 亚洲欧洲精品一区二区三区不卡| 欧美精品777| 国产99久久久精品| 日本中文字幕一区二区视频 |