【圖靈圖書推薦】Java解惑 Java教程(第4版)
“Java教父”Joshua Bloch帶你深入Java語言奇境 Sun公司官方指定教材即將出版!涵蓋JavaSE 6
因為審稿中發現一個技術問題,查詢到Sun公司網站上的Java文檔,偶然發現了這個對Java SE 6知識的小測試。大家不妨試一試。
題目包括:
- Java SE 6平台上能夠使用哪種指令碼語言?
- 什麼是Unicode文本的正常化?
- 怎樣啟動電腦上的預設瀏覽器查看特定URL?
- 如何給JTable的內容排序?
- 使用Java API for XML Web Services (JAX-WS) 2.0將一個方法發布為Web服務作業,應該使用哪個註解(annotation)?
- ……
應該說不是非常深,但是涉及面廣。由雩都是選擇題,我雖然對Java 6沒有太多經驗,還是答了個八九不離十。你呢?
其實學習中多進行這種測試是非常重要的,Java語言本身方面的測試題最好的來源當然是“Java教父”Joshua Bloch(JavaSE5的開發老大,Java Collection API的開發人員,目前是Goolge Java方面的老大)的《Java解惑》一書。裡面的題目既深入又有趣。
【20070713更新】今天又發現一篇關於Java面試題的文章,來自Java Developer‘s Journal。其中題目的深度要好得多,一共30道。其中星號的多少表示難度。題目包括:
* Q1. How could Java classes direct program messages to the system console, but error messages, say to a file?
* Q2. What's the difference between an interface and an abstract class?
* Q4. Explain the usage of the keyword transient?
* Q5. How can you force garbage collection?
* Q6. How do you know if an explicit object casting is needed?
* Q7. What's the difference between the methods sleep() and wait()?
……
* Q20. How can a subclass call a method or a constructor defined in a superclass?
……
** Q22. You can create an abstract class that contains only abstract methods. On the other hand, you can create an interface that declares the same methods. So can you use abstract classes instead of interfaces?
** Q25. If you're overriding the method equals() of an object, which other method you might also consider?
** Q29. There are two classes: A and B. The class B need to inform a class A when some important event has happened. What Java technique would you use to implement it?
……
【延伸閱讀】
Java教父Joshua Bloch訪談
一本你肯定可以讀懂的Java圖書II
新聞:Java開源,主將辭職
2006 Java回顧與展望
《Java解惑》上市,大家一起來做Java思維體操!