国产午夜成人免费看片无遮挡_日本免费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>

        欧美日韩亚州综合| 国产喷白浆一区二区三区| 91在线观看免费视频| 欧美一区二区啪啪| 日韩高清不卡在线| 欧美伊人久久久久久午夜久久久久| 中文字幕av一区 二区| 韩国精品在线观看| 日韩亚洲欧美成人一区| 久久不见久久见免费视频7| 日韩美女视频在线| 成人高清视频在线| 亚洲高清不卡在线| 久久久久久久久久看片| 在线观看一区不卡| 麻豆国产欧美日韩综合精品二区| 日韩无一区二区| 国产精品自在欧美一区| 国产欧美日韩精品a在线观看| av在线一区二区三区| 亚洲高清视频的网址| 中文字幕久久午夜不卡| 成人精品一区二区三区四区| 中文字幕精品一区二区精品绿巨人 | 日本欧美韩国一区三区| 欧美一级片在线| 99re热视频精品| 国内偷窥港台综合视频在线播放| 欧美激情一区二区三区不卡| 欧美日韩精品专区| 99国产精品久久| 日本电影亚洲天堂一区| 午夜精品一区二区三区免费视频| 久久男人中文字幕资源站| 欧美日韩一区小说| 在线看国产日韩| 欧洲精品一区二区三区在线观看| 福利视频网站一区二区三区| 久久99国产精品免费| 日本va欧美va瓶| 婷婷六月综合亚洲| 亚洲电影中文字幕在线观看| 一区二区理论电影在线观看| 国产精品福利一区| 一区二区三区日本| 亚洲国产日日夜夜| 蜜臀91精品一区二区三区| 秋霞影院一区二区| 国产精品一区不卡| 91蜜桃视频在线| 在线播放中文一区| 久久亚区不卡日本| 中文字幕av一区二区三区| 亚洲精品日韩专区silk| 秋霞电影网一区二区| 国产综合色视频| 成人app在线| 精品久久久久久久久久久久包黑料| 久久综合九色欧美综合狠狠| 久久精品男人的天堂| 五月天欧美精品| 成人av在线资源网| 日韩一区二区三免费高清| 国产精品久久久久影院亚瑟| 一二三四社区欧美黄| 国产成人午夜99999| 精品乱人伦小说| 亚洲一区免费在线观看| 风间由美一区二区av101| 欧美高清hd18日本| 五月婷婷另类国产| 欧美自拍丝袜亚洲| 一个色妞综合视频在线观看| 大桥未久av一区二区三区中文| 欧美一区二区成人6969| 视频在线观看一区| 91精品国产综合久久久蜜臀粉嫩| 樱花草国产18久久久久| 欧美亚洲综合网| 亚洲福利国产精品| 在线播放中文一区| 捆绑变态av一区二区三区| 日韩欧美一区二区三区在线| 日韩成人精品在线| 精品日韩欧美一区二区| 国产精品99久久久久久似苏梦涵| 26uuu精品一区二区| www.欧美.com| 亚洲图片欧美色图| 精品美女一区二区| 不卡视频在线观看| 日日夜夜免费精品| 五月天一区二区| 日韩一区二区电影| 99久久精品免费看国产 | 国产麻豆精品在线| 久久久噜噜噜久噜久久综合| 成人福利在线看| 蜜桃一区二区三区在线| 中文字幕不卡三区| 日韩欧美一二区| 欧美色图片你懂的| 国产不卡在线一区| 日韩黄色小视频| 亚洲一区二区成人在线观看| 精品久久久久99| 日韩视频免费观看高清在线视频| 国产99久久久国产精品潘金网站| 亚洲综合男人的天堂| 国产精品超碰97尤物18| 亚洲精品一区二区三区四区高清| 91久久精品一区二区| 成人午夜在线播放| 国产精品香蕉一区二区三区| 另类小说欧美激情| 久热成人在线视频| 激情五月激情综合网| 韩国成人在线视频| 成人国产精品免费观看动漫| 国产成人午夜片在线观看高清观看| 国产精品自拍网站| 国产一区二三区| 国产成人a级片| 91一区在线观看| 欧美一级久久久久久久大片| 日韩限制级电影在线观看| 久久一二三国产| 国产欧美日韩在线视频| 亚洲日本电影在线| 午夜精品影院在线观看| 国产福利不卡视频| 欧美三电影在线| 久久精品欧美一区二区三区不卡 | 日韩欧美中文一区| 久久人人97超碰com| 亚洲国产精品久久人人爱| 日韩国产精品久久| 成人精品在线视频观看| 日韩免费观看高清完整版 | 日韩一区二区在线观看| 国产精品你懂的在线欣赏| 亚洲一区二区三区激情| 成人精品国产福利| 国产精品伦理在线| 麻豆中文一区二区| 欧美日韩国产一二三| 国产精品毛片大码女人| 美美哒免费高清在线观看视频一区二区| 国产一区999| 日韩欧美成人午夜| 久久国产综合精品| 欧美一级片在线观看| 青青草成人在线观看| 欧美日韩性生活| 午夜精品一区二区三区三上悠亚| 91丨porny丨蝌蚪视频| 亚洲特级片在线| 91搞黄在线观看| 亚洲高清免费观看高清完整版在线观看| 成人激情电影免费在线观看| 国产精品美女视频| 一本久道久久综合中文字幕| 日韩理论片网站| 欧美福利视频一区| 极品瑜伽女神91| 亚洲视频每日更新| 欧美亚洲免费在线一区| 免费av成人在线| 国产日产欧美一区二区三区| 成人av在线播放网站| 亚洲综合久久久久| 久久一夜天堂av一区二区三区| 国产成人综合精品三级| 玉米视频成人免费看| 日韩欧美一级二级三级久久久| 成人激情文学综合网| 日韩电影网1区2区| 亚洲色图19p| 国产欧美精品一区二区三区四区| 欧美亚洲自拍偷拍| 99久久精品久久久久久清纯| 麻豆国产欧美日韩综合精品二区| 国产精品福利电影一区二区三区四区| 欧美亚洲综合一区| 色综合咪咪久久| 99re热视频这里只精品| 国产成人三级在线观看| 日韩不卡一区二区| 天天综合网 天天综合色| 亚洲女人小视频在线观看| 国产精品私人影院| 国产精品美女久久久久久久| 精品国产一区二区亚洲人成毛片| 欧美午夜一区二区| 欧美一区二区在线观看| 日韩欧美在线影院| 国产午夜亚洲精品不卡| 国产精品久久久久影院亚瑟| 中文字幕 久热精品 视频在线 | 成人小视频免费在线观看|