本來以為在client 端要傳輸JSON物件到ASP來做反序列化(Deserialize) 後來才知道做了多餘的事情
 

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

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

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

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

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

未命名
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) 人氣()

GLUT官方下載頁面 https://www.opengl.org/resources/libraries/glut/glut_downloads.php
GLUT官方下載點 https://www.opengl.org/resources/libraries/glut/glutdlls37beta.zip
GLUT第四版API https://www.opengl.org/sdk/docs/man4/

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

 
 
 





第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();






答案:






題目範圍:串流






解析:


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


defaultReadObject 是搭配defaultWriteObject 使用的






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

 
 
 





第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.






答案:






題目範圍:例外處理






解析:


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


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






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

 
 
 





第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






答案:






題目範圍:例外處理






解析:


因為NullPointerException永遠不會被捕捉到


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






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

 
 
 





第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.






答案:






題目範圍:例外處理






解析:


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


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


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






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

 
 
 





第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) 人氣()

 
 
 





第121題:






Given:


11. public class Test{
12.     public enum Dogs {collie, harrier, shepherd},
13.    public static void main(String[] args){
14.         Dogs myDog = Dogs.shepherd;
15.         switch(myDog){
16.             case collie:
17.                 System.out.print("collie ");
18.             case default:
19.                 System.out.print("retriever "),
20.             case harrier:
21.                 System.out.print("harrier ");
22.         }
23.     }
24. }






What is the result?


A. harrier


B. shepherd


C. retriever


D. Compilation fails


E. retriever harrier


F. An exception is thrown at runtime,






答案:






題目範圍:基本觀念,switch






解析:


這題藏了三個錯誤,分別是:


Enum那行最後的逗號應該被刪掉


System.out.print("retriever "), 的逗號


還有case default: 應該改為default:






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

 
 
 





第116題:






Given:


11. public class Commander{
12.     public static void main(String[] args){
13.         String myProp = /* insert code here */
14.         System.out.println(myProp);

15.     }
16. }
and the command line:


java -Dprop.custom=gobstopper Commander






Which two, placed on line 13, will produce the output gobstopper? (Choose two.)


A. System.load("prop.custom");


B. System.getenv("prop.custom");


C. System.property("prop.custom);


D. System.getProperty("prop.custom");


E. System.getProperties().getProperty("prop.custom");






答案:DE






題目範圍:System下的方法






解析:


System.load方法可以傳入一個檔案位址,讓程式將指定檔案的內容加入函式庫中


System.getenv方法會回傳對應輸入的環境變數,例如你可以輸入"JAVA_HOME"


System.property,沒有這個方法


System.getProperty會回傳在執行檔案時所定義的屬性


System.getProperties會回傳一個hashtable裡面包含很多系統資訊,詳細請上網搜尋






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

1 2 3 4 5
Blog Stats
⚠️

成人內容提醒

本部落格內容僅限年滿十八歲者瀏覽。
若您未滿十八歲,請立即離開。

已滿十八歲者,亦請勿將內容提供給未成年人士。