標籤:1:反射(理解)(1)類的載入及類載入器(2)反射:通過位元組碼檔案對象,去使用成員變數,構造方法,成員方法(3)反射的使用A:通過反射擷取構造方法並使用B:通過反射擷取成員變數並使用C:通過反射擷取成員方法並使用(4)反射案例A:通過反射回合組態檔案的內容B:通過反射越過泛型檢查C:通過反射給任意的一個對象的任意的屬性賦值為指定的值(5)動態代理2:設計模式(1)裝飾設計模式BufferedReader br = new BufferedReader(new
標籤:leetcode java insert interval 題目:Given a set of non-overlapping intervals, insert a new interval into the intervals (merge if necessary).You may assume that the intervals were initially
標籤:leetcode java spiral matrix ii 題目:Given an integer n, generate a square matrix filled with elements from 1 to n2 in spiral order.For example,Given n = 3,You should
標籤: 把自己在學習Java過程中遇到的各種問題列出來,寫上自己各個時期對這個問題的想法,直到最後解決,應該會對堅持學習這件事有推動的。看到講Java基礎的一章,有一段代碼裡寫 private Point center(P65),Point是啥東西啊,這個位置不應該是資料類型嗎?之所以不理解可能是前面講資料類型和運算的時候有哪一點被遺漏掉了,也可能是在後面有講我還沒看到。這個問題暫時不影響大局,可以先放一放--2015/07/15Java學習中遇到的問題與後期思考
標籤:I had a couple of interviews long ago which asked me to implemented a least recently used (LRU) cache. A cache itself can simply be implemented using a hash table, however adding a size limit gives an interesting twist on the question.
標籤:1、考慮使用靜態Factory 方法代替構造器。這麼做如下優勢:靜態方法Factory 方法具有變數名稱。比如定義在Boolean類的TRUE對象,具有名稱十分直觀。Boolean.TRUEpublic static final Boolean TRUE = new Boolean(true);不必每次調用的時候都建立新對象。如果建立對象代價很高,使用靜態類可以提升效能。可以返回聲明返回類的任意子類對象。public static Service