在线看毛片视频-国产免费av在线-欧美日韩一区二区三区-国产成人无码av在线播放无广告-亚洲人va欧美va人人爽-国产第一草草-西班牙黄色片-四虎在线网站8848-最新av片免费网站入口-东京热无码中文字幕av专区-日本大人吃奶视频xxxx-欧美精品一区二区三区四区五区-国产片天天弄-国产免费内射又粗又爽密桃视频-欧美爱爱网站-日韩v欧美

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

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是 接口。

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

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

本類教程下載

系統下載排行

在线看毛片视频-国产免费av在线-欧美日韩一区二区三区-国产成人无码av在线播放无广告-亚洲人va欧美va人人爽-国产第一草草-西班牙黄色片-四虎在线网站8848-最新av片免费网站入口-东京热无码中文字幕av专区-日本大人吃奶视频xxxx-欧美精品一区二区三区四区五区-国产片天天弄-国产免费内射又粗又爽密桃视频-欧美爱爱网站-日韩v欧美
  • <li id="86scu"><menu id="86scu"></menu></li>
    <li id="86scu"></li>
    <button id="86scu"></button>
  • <s id="86scu"></s><button id="86scu"><menu id="86scu"></menu></button>
  • 国产成人强伦免费视频网站| 成熟丰满熟妇高潮xxxxx视频| 日本精品一区二区三区四区| 免费看黄色a级片| 亚洲制服在线观看| 黄色片免费网址| 婷婷中文字幕在线观看| 成 人 黄 色 小说网站 s色| 黄色aaa级片| 奇米视频7777| 欧美日韩视频免费在线观看| 亚欧精品在线视频| 穿情趣内衣被c到高潮视频| 秋霞在线一区二区| 无码熟妇人妻av在线电影| 日韩成人三级视频| 国产a级一级片| 欧美黄色性生活| 黄色片免费网址| 国产精品www在线观看| 野外做受又硬又粗又大视频√| 国产一级大片免费看| 日韩欧美猛交xxxxx无码| 国产一二三在线视频| 国产成人综合一区| 九九久久久久久| 欧美二区在线视频| 天天操,天天操| 99er在线视频| 男女污污的视频| 免费极品av一视觉盛宴| 久久久久免费精品| 日韩视频在线观看视频| 欧美变态另类刺激| 亚洲欧美手机在线| 国产3p露脸普通话对白| 污片在线免费看| 丁香花在线影院观看在线播放| 任你操这里只有精品| 视频一区二区视频| 国产又大又黄又粗的视频| 国产911在线观看| aa免费在线观看| 国产肉体ⅹxxx137大胆| 手机在线成人免费视频| 国产玉足脚交久久欧美| 狠狠干狠狠操视频| 中文字幕欧美人妻精品一区| 狠狠干视频网站| 中文字幕网av| 久久婷婷国产精品| 日韩av在线第一页| 日韩一级特黄毛片| 久久精品国产精品亚洲精品色 | 小说区视频区图片区| 国产精品后入内射日本在线观看| 99国产精品久久久久久| 成年人在线看片| 日本一区二区黄色| 国产av麻豆mag剧集| 乱子伦一区二区| 国产日韩视频在线播放| 国产福利在线免费| 中文av一区二区三区| 国产精品丝袜久久久久久消防器材| 50度灰在线观看| 善良的小姨在线| 三级性生活视频| 欧美一级小视频| 国产永久免费网站| 天堂网成人在线| 特色特色大片在线| 国产一区二区三区小说| 国产91沈先生在线播放| 69精品丰满人妻无码视频a片| 老司机午夜免费福利视频| 欧美aaa在线观看| avove在线观看| 久久久久久人妻一区二区三区| 分分操这里只有精品| 欧美视频在线观看视频| 中文字幕无码精品亚洲资源网久久| bt天堂新版中文在线地址| 久操网在线观看| 男女午夜激情视频| 在线观看免费不卡av| 中文字幕一区二区三区四| gogogo免费高清日本写真| 99热久久这里只有精品| 少妇高潮毛片色欲ava片| 激情五月开心婷婷| 激情图片中文字幕| 日本免费a视频| 欧美精品成人网| 欧洲美女亚洲激情| 男人添女人下部高潮视频在观看| 久久久噜噜噜www成人网| 日本在线观看免费视频| 欧美日韩中文字幕在线播放| 国产二区视频在线| 国内自拍视频网| 成人性生活视频免费看| 韩国视频一区二区三区| 日韩人妻无码精品久久久不卡| 成年人视频在线免费| 久久久国产精华液999999| 国产制服91一区二区三区制服| 91av在线免费播放| 亚洲色成人www永久在线观看| 日韩在线xxx| 成人免费a级片| 国产资源中文字幕| 亚洲人成色77777| 91午夜在线观看| 日本一区二区免费高清视频| 男人用嘴添女人下身免费视频| 一级做a免费视频| 男人日女人bb视频| 一级黄色录像免费看| 99热这里只有精品在线播放| 97久久国产亚洲精品超碰热| 欧洲美女亚洲激情| 天天爽夜夜爽一区二区三区| 久久国产亚洲精品无码| 国产亚洲精品久久久久久久| 91看片破解版| 久久这里只精品| 免费一级特黄录像| 哪个网站能看毛片| 丝袜老师办公室里做好紧好爽| 中文字幕日韩精品无码内射| 99久久99精品| 国产欧美精品一二三| 手机av在线网站| 992kp免费看片| 四虎1515hh.com| 日本丰满少妇黄大片在线观看| 国产精品v日韩精品v在线观看| 99免费视频观看| 91国产精品视频在线观看| 一级黄色香蕉视频| 欧美女同在线观看| 五月天婷婷亚洲| 亚洲免费黄色录像| 午夜探花在线观看| 久久免费一级片| 日韩黄色短视频| 亚洲精品乱码久久久久久自慰| 国产成人a亚洲精v品无码| 黑鬼大战白妞高潮喷白浆| 久久久久久久少妇| 午夜天堂在线视频| 欧美 另类 交| 国产69精品久久久久久久| 国产精彩免费视频| 在线观看av免费观看| 国产成人一二三区| 加勒比成人在线| jizz大全欧美jizzcom| 欧美日韩久久婷婷| 中文字幕无码精品亚洲资源网久久| 日本精品一区二区三区四区| 精品亚洲视频在线| 婷婷无套内射影院| av在线无限看| 国产亚洲精品久久久久久久| 91看片就是不一样| 精品国产一区二区三区在线| 黄色网页免费在线观看| 91视频这里只有精品| 成人黄色大片网站| 国产精品久久a| 欧美乱大交xxxxx潮喷l头像| 国产野外作爱视频播放| 日韩av中文字幕第一页| www.se五月| 亚洲乱码中文字幕久久孕妇黑人| 国产探花在线看| 国产成人精品视频免费看| 成人免费黄色av| 美女网站色免费| 国产精品97在线| 老子影院午夜伦不卡大全| 欧美国产日韩另类 | 好吊色这里只有精品| 中文字幕乱码人妻综合二区三区| 色黄视频免费看| 91n.com在线观看| 逼特逼视频在线| 97在线国产视频| 4444在线观看| av磁力番号网| 三级av免费看| 国产91av视频在线观看| 婷婷免费在线观看| xxww在线观看| 波多野结衣在线免费观看| 奇米视频888| 色呦呦网站入口| 樱花草www在线|