PIXNET Logo登入

來喝杯JAVA咖啡

跳到主文

來喝JAVA咖啡吧

部落格全站分類:生活綜合

  • 相簿
  • 部落格
  • 留言
  • 名片
  • 8月 04 週一 201414:39
  • ASP.NET 使用 ajax 傳遞 Json 物件

本來以為在client 端要傳輸JSON物件到ASP來做反序列化(Deserialize) 後來才知道做了多餘的事情
 
(繼續閱讀...)
文章標籤

yaya741228 發表在 痞客邦 留言(0) 人氣(3,257)

  • 個人分類:喝點JAVA
▲top
  • 7月 27 週日 201417:41
  • JQuery plugin 樣板 深入與淺出

我們在使用jQuery ui plugin 時,總是能夠享受到其中許多便利性:plugin 快速並且簡單明瞭的對選擇出來的區塊進行改造與操作
一個強大、功能完善的plugin 應該具備下列幾項要點
1. 可以靠傳入的參數來改變plugin 的形式,做客製化的調整
2. 提供plugin 相關的method,來對plugin 做操作
(繼續閱讀...)
文章標籤

yaya741228 發表在 痞客邦 留言(0) 人氣(1,119)

  • 個人分類:喝點JAVA
▲top
  • 7月 25 週五 201414:49
  • JSP與ASP 語法差異

因為工作上需要,學習ASP
之前都是接觸JSP,因此這篇文章主要是以JSP作為出發點來寫的
下列是依些功能上的比較
表格參數傳遞
JSP
request.getParameter("key")
(繼續閱讀...)
文章標籤

yaya741228 發表在 痞客邦 留言(0) 人氣(778)

  • 個人分類:喝點JAVA
▲top
  • 6月 30 週日 201315:13
  • JME3 圖形介面 nifty 筆記

未命名
1. 使用nifty
要使用nifty的話,就在程式碼中加入下列這一段
NiftyJmeDisplay niftyDisplay = new NiftyJmeDisplay(assetManager, inputManager, audioRenderer,guiViewPort);
Nifty nifty = niftyDisplay.getNifty();
nifty.fromXml("nifty.xml", "start", this);
 guiViewPort.addProcessor(niftyDisplay);
(繼續閱讀...)
文章標籤

yaya741228 發表在 痞客邦 留言(0) 人氣(705)

  • 個人分類:喝點JAVA
▲top
  • 9月 22 週六 201219:19
  • GLUT開發-3D遊戲設計課程

GLUT官方下載頁面 http://www.opengl.org/resources/libraries/glut/glut_downloads.php
GLUT官方下載點 http://www.opengl.org/resources/libraries/glut/glutdlls37beta.zip
GLUT第四版API http://www.opengl.org/sdk/docs/man4/
(繼續閱讀...)
文章標籤

yaya741228 發表在 痞客邦 留言(0) 人氣(1,233)

  • 個人分類:
▲top
  • 7月 18 週三 201217:41
  • SCJP 6.0考古題解析 (146~150)

 
 
 





第146題:






Given:


1. import java.io.*;
2. public class Foo implements Serializable{
3.     public int x, y;
4.     public Foo(int x, int y){this.x = x; this.y = y;}
5.
6.     private void writeObject(ObjectOutputStream s)
7.                             throws IOException{
8.         s.writeInt(x); s.writeInt(y);
9.     }
10.
11.     private void readObject(ObjectInputStream s)
12.     throws IOException, ClassNotFoundException{
13.
14.         //insert code here
15.

16.     }
17. }






Which code, inserted at line 14, will allow this class to correctly serialize and deserialize?


A. s.defaultReadObject();
B. this = s.defaultReadObject(),
C. y = s.readInt(); x = s.readInt();
D. x = s.readInt(); y = s.readInt();






答案:D






題目範圍:串流






解析:


因為讀出串流時,順序是x 然後y,因此寫入時應該也要一樣先x 然後y


defaultReadObject 是搭配defaultWriteObject 使用的






(繼續閱讀...)
文章標籤

yaya741228 發表在 痞客邦 留言(13) 人氣(10,833)

  • 個人分類:喝點JAVA
▲top
  • 7月 09 週一 201223:42
  • SCJP 6.0考古題解析 (141~145)

 
 
 





第141題:






Given:


11. class A{
12.     public void process(){System.out.print("A, ");}
13. class B extends A{
14.     public void process() throws IOException{
15.     super.process();
16.     System.out.print("B, ");
17.     throw new IOException();
18. }
19. public static void main(String[] args){
20.     try{new B().process();}
21.     catch(IOException e){System.out.println("Exception");}
22. }






What is the result?


A. Exception
B. A, B, Exception
C. Compilation fails because of an error in line 20.
D. Compilation fails because of an error in line 14.
E. A NullPointerException is thrown at runtime.






答案:D






題目範圍:例外處理






解析:


B類別在覆寫A類別的process()方法時,由於A.process()類別並沒有擲出IOException,因此B.process()也不可擲出IOException


如果A.process()有擲出Exception,則B.process()可以擲出IOException(因為是Exception的子類別),但裡面的super.process();必須再做例外處理






(繼續閱讀...)
文章標籤

yaya741228 發表在 痞客邦 留言(5) 人氣(4,850)

  • 個人分類:喝點JAVA
▲top
  • 7月 07 週六 201212:22
  • SCJP 6.0考古題解析 (136~140)

 
 
 





第136題:






Given:


11. public static void main(String[] args){
12.     try{
13.         args = null;
14.         args[0] = "test";
15.         System.out.println(args[0]);
16.     }catch(Exception ex) {
17.         System.out.println("Exception");
18.     }catch(NullPointerException npe){
19.         System.out.println("NullPointerException");
20.     }
21. }






What is the result?


A. test
B. Exception
C. Compilation fails.
D. NullPointerException






答案:C






題目範圍:例外處理






解析:


因為NullPointerException永遠不會被捕捉到


編譯階段會出現錯誤,原因是這個例外已經在先前被Exception捕捉了






(繼續閱讀...)
文章標籤

yaya741228 發表在 痞客邦 留言(3) 人氣(4,738)

  • 個人分類:喝點JAVA
▲top
  • 7月 07 週六 201201:40
  • SCJP 6.0考古題解析 (131~135)

 
 
 





第131題:






Given:


    static void test() throws Error {
        if (true)
            throw new AssertionError();
        System.out.print("test ");
    }

    public static void main(String[] args) {
        try {
            test();
        } catch (Exception ex) {
            System.out.print("exception ");
        }
        System.out.print("end ");
    }






What is the result?


A. end
B. Compilation fails.
C. exception end
D. exception test end
E. A Throwable is thrown by main.
F. An Exception is thrown by main.






答案:E






題目範圍:例外處理






解析:


Error和Exception都是Throwable的類別
但兩者並沒有繼承關係


在丟出Error的時候,無法被catch (Exception ex)所接到,因此最後會被main方法丟出


Error沒有強制規定必須被catch,因此並不會出現Compilation fails






(繼續閱讀...)
文章標籤

yaya741228 發表在 痞客邦 留言(4) 人氣(5,361)

  • 個人分類:喝點JAVA
▲top
  • 2月 18 週六 201223:20
  • SCJP 6.0考古題解析 (126~130)

 
 
 





第126題:






Given:


31. //some code here
32. try{
33.     //some code here
34. }catch(Some Exception se) {
35.     //some code here
36. }finally{
37.     //some code here
38. }






Under which three circumstances will the code on line 37 be executed? (Choose three.)


A. The instance gets garbage collected.


B. The code on line 33 throws an exception.


C. The code on line 35 throws an exception.


D. The code on line 31 throws an exception.


E. The code on line 33 executes successfully






答案:BCE






題目範圍:例外處理






解析:


只要進入了try/catch 裡面,不論如何都會在最後執行finally的內容






(繼續閱讀...)
文章標籤

yaya741228 發表在 痞客邦 留言(5) 人氣(5,044)

  • 個人分類:喝點JAVA
▲top
12...6»

BloggerAds

文章分類

  • 喝點JAVA (46)
  • 超宅食譜 (7)
  • 未分類文章 (1)

文章搜尋

熱門文章

  • (47,659)SCJP 6.0考古題解析 (1~5)
  • (41,379)使用Eclipse開發JSP環境
  • (12,581)在JSP透過FileUpload上傳檔案(官網原文翻譯)
  • (6,563)美式軟餅乾食譜
  • (6,183)SCJP 6.0考古題解析 (61~65)
  • (5,953)SCJP 6.0考古題解析 (71~75)
  • (4,637)西點的葵花寶典--蛋的使用
  • (4,538)SCJP 6.0考古題解析 (101~105)
  • (2,998)一天五題SCJP(11~15)
  • (1,956)安裝JAVA開發3D環境

最新文章

  • ASP.NET 使用 ajax 傳遞 Json 物件
  • JQuery plugin 樣板 深入與淺出
  • JSP與ASP 語法差異
  • JME3 圖形介面 nifty 筆記
  • GLUT開發-3D遊戲設計課程
  • SCJP 6.0考古題解析 (146~150)
  • SCJP 6.0考古題解析 (141~145)
  • SCJP 6.0考古題解析 (136~140)
  • SCJP 6.0考古題解析 (131~135)
  • SCJP 6.0考古題解析 (126~130)

個人資訊

yaya741228
暱稱:
yaya741228
分類:
生活綜合
好友:
累積中
地區:

參觀人氣

  • 本日人氣:
  • 累積人氣:

no ad