? asked in 社會與文化語言 · 1 decade ago

看不懂,請幫我英文翻中文的翻譯,和JAVA程式的說明(2)

看不懂,請幫我英文翻中文的翻譯,和JAVA程式的說明(或只有翻譯中文或解釋JAVA程式也可以)

6.

System.out.printf("Pi is approximately %f and E is approximately %b", Math.PI, Math.E);

Place the values where they would appear in the output.

Pi is approximately

and E is approximately

7.

When comparing java.io.BufferedWriter to java.io.FileWriter,which capability exists as a method in only one of the two?

E.

writing a line separator to the stream

8.

public class TestString3{

public static void main (String [] args){

//insert code here

System. out. println(s);

}

}

Which two code fragment,inserted independently at line 3,generate the output 4247?(Choose two.)

B.

StringBuffer s = new StringBuffer ("123456789");

s.delete(0,3).replace (1,3,"24").delete (4,6);

E.

StringBuilder s = new StringBuilder ("123456789");

s.delete (0,3).delete (1,3).delete (2,5).insert (1, "24");

9.

Which three statements concerning the use of the java.io. Serializable interface are true?(Choose three.)

B.

An object from classes that use aggregation cannot be serialized.

C.

The values in fields with the volatile modifier will NOT survive serialization and deserialization.

E.

It is legal to serialize an object of a type that has a supertype that does NOT implement java. lo. Serializable.

10.

public class Wow{

public static void go (short n){System. out. Print ln ("short";}

public static void go (Short n){System. out. print ln ("SHORT");}

public static void go (Long n){System. Out. Print ln("LONG");}

Short y=6;

int z=7

go(y);

go(z);

}

}

What is the result?

C.

Compilation fails

2 Answers

Rating
  • 成傑
    Lv 5
    1 decade ago
    Favorite Answer

    PENY 大大您好:

    請問您是想考SCJP的證照是嗎?

    8.

    public class TestString3{

    public static void main (String [] args){

    //insert code here 請把B和E的程式碼放入,實作一下,就知道結果

    System. out. println(s);

    }

    }

    Which two code fragment,inserted independently at line 3,generate the output 4247?(Choose two.)哪兩個程式碼建立在第三行時,會輸出4247這個數值,請選兩個答案

    B.

    StringBuffer s = new StringBuffer ("123456789");

    s.delete(0,3).replace (1,3,"24").delete (4,6);

    E.

    StringBuilder s = new StringBuilder ("123456789");

    s.delete (0,3).delete (1,3).delete (2,5).insert (1, "24");

    9.

    Which three statements concerning the use of the java.io. Serializable interface are true?(Choose three.)(哪三個陳述關於使用java.io. Serializable介面是真的)

    10.

    public class Wow{

    public static void go (short n){System. out. Print ln ("short";}

    public static void go (Short n){System. out. print ln ("SHORT");}

    public static void go (Long n){System. Out. Print ln("LONG");}

    Short y=6;

    int z=7

    go(y);

    go(z);

    }

    }

    What is the result?(根據上列程式碼,執行結果為?)

    C.

    Compilation fails 執行失敗

    (因為程式碼不完整)

    想考SCJP,不能光靠背題目,實作很重要,多做幾次答案就明瞭了

    尤其是考古題的答案不全然正確的

    Source(s): 自己
    • Commenter avatarLogin to reply the answers
  • 1 decade ago

    我的翻譯寫好了,至於java 語法不太對 請參閱http://blog.xuite.net/almore.chang/2 almore THKS!!

    註明:因這個框框限制300字元不夠放,所以放在自己的部落格中.

    • Commenter avatarLogin to reply the answers
Still have questions? Get your answers by asking now.