? asked in 電腦與網際網路程式設計 · 1 decade ago

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

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

11.

-dis a valid, non-null Date object

=df is a valid, non-null DateFormat object set to the current locale

what outputs the current locale's country name and the appropriate version of d's date?

B.

Locale loc = Locale. getDefault ();

System. Out. Print ln (loc. getDisplayCountry()

+""+ df.format (d));

12.

public class Threads3 implements Runnable{

public void run(){

System .out. print ("running");

}

public static void main (String[]args){

Thread t =new Thread (new Threads 3());

t. run ();

t. run ();

t. start ();

}

}

What is the result?

E.

The code executes and prints "runningrunningrunning"

13.

Click the Exhibit button.

Which two are possible results?(Choose two.)

A.0,2,4,4,6,8,10,6,

C.0,2,4,6,8,10,12,14,

14.

void waitForSignal(){

Object obj = new Object ();

synchronized (Thread. Current Thread ()){

obj. wait ();

obj. notify ();

}

}

Which statement is true?

B.

This code may throw an lllegalStateException.

15.

public class TestOne implements Runnable{

public static void main (String [] args) throws Exception{

t. start ();

System .out. print ("Complete");

}

public void run (){

for (int | =0; | <4;i++){

System .out. print (i);

}

}

}

What can be a result?

E.

The code executes and prints "Started0123Complete"

3 Answers

Rating
  • 1 decade ago
    Favorite Answer

    這些是SCJP考題-關於執行緒及API的部分:其中方法請參閱API

    t11.

    //d是一個合法有效的date物件

     d is a valid, non-null Date object

    //df是一個合法有效的dateformat物件

     df is a valid, non-null DateFormat object set to the current locale

    //何者可輸出當前國家名稱及適當的日期格式

     what outputs the current locale's country name and the appropriate

     version of d's date?

     B.

    //getDefault()取得JVM實體所在位置的預設值

    //getDisplayCountry()回傳一符合使用者所在之國家名稱

    //dateFormat.format(Date date)

    //建立Locale實體

     Locale loc = Locale. getDefault ();

    //列印本地時間資料及國家名稱

     System.out.println(loc.getDisplayCountry()+""+ df.format (d));

    12.

    //宣告類別實作Runnable介面

     public class Threads3 implements Runnable{

    //implements 介面必須完成該介面中的方法

    //實作run方法

     public void run(){

    //列印running

      System .out. print ("running");

     }

    //主程式進入點

     public static void main (String[]args){

      //建立Thread3物件實體

      Thread t =new Thread (new Threads3());

      //Threads0執行一次

      t. run ();

      //Threads0執行一次

      t. run ();

      //Thread-main執行一次

      t. start ();

     }

    }

    //答案為何

     What is the result?E.

    //程式執行並印出該字串

     The code executes and prints "runningrunningrunning"

    13.這題沒有列出題目喔~

    //點擊按鈕

     Click the Exhibit button.

    //何者是正確的答案(選兩個)

     Which two are possible results?(Choose two.)

      A.0,2,4,4,6,8,10,6,

      C.0,2,4,6,8,10,12,14,

    14.

    //宣告一個沒有回傳值的waitForSignal方法

     void waitForSignal(){

    //建立一個物件obj

     Object obj = new Object ();

     使用synchronized ← 鎖定資料避免維護物件被別的執行續使

     用synchronized (Thread. Current Thread ()){

    //呼叫wait方法

     obj. wait ();←執行緒進入waiting pool等待再度被呼叫

    //呼叫執行緒

     obj. notify ();←呼叫在waiting pool中的執行緒

     }

    }

     Which statement is true?B.

    //本程式碼會產生lllegalStateException的例外事件

     This code may throw an lllegalStateException.

    15.//TestIne實作Runnable介面

     public class TestOne implements Runnable{

      //主程式進入點

      public static void main (String [] args) throws Exception{

       //這裡少一行程式碼 t是甚麼?幫你宣告

       Thread t = new Thread(new TestOne());

       //執行緒啟動,執行本類別的Run方法

       t. start ();

       //列印Complete

       System.out.print("Complete");

      }

      //run方法

      public void run (){

       //for迴圈

       for (int | =0; | <4;i++){

       //列印 i 值

       System .out. print (i);

      }

     }

    }

    //結果為何

     What can be a result?E.

     //程式碼執行並且列印

     The code executes and prints "Started0123Complete"

    2008-08-02 02:22:30 補充:

    的確 尤其是看到公眾排泄跑的那段

     

    我跟我同學笑到快要公眾排泄跑了

     

  • 1 decade ago

    程式要會看從最基本著手

    宣告

    廻圈

    變數

    亂數

    都是最基礎的

    光字面的意思

    就百百種

    看最後要的結果而定

    沒有唯一公式的

    解釋你參考看看

    11.

    -dis a valid, non-null Date object

    =df is a valid, non-null DateFormat object set to the current locale

    what outputs the current locale's country name and the appropriate version of d's date?

    11.

    dis一合法,非無效的日期對象=df是一個合法,非無效的DateFormat對象被設置對當前地點什麼產品當前地點的國名和d的日期的適當的版本?

    B.

    Locale loc = Locale. getDefault ();

    System. Out. Print ln (loc. getDisplayCountry()

    +""+ df.format (d));

    B.

    地點地點=地點。 getDefault (); 系統。 。 印刷品ln (地點。 getDisplayCountry () + "" + df.format (d));

    12.

    public class Threads3 implements Runnable{

    public void run(){

    System .out. print ("running");

    }

    public static void main (String[]args){

    Thread t =new Thread (new Threads 3());

    t. run ();

    t. run ();

    t. start ();

    }

    }

    What is the result?

    12.

    公開類Threads3實施可追捕{公眾空隙跑() {系統.out。 印刷品(「跑」); }公開靜止空隙主要(串[] args) {螺紋t =new螺紋(新的螺紋3 ()); T. 奔跑(); T. 奔跑(); T. 開始(); }}什麼是結果?

    E.

    The code executes and prints "runningrunningrunning"

    E.

    代碼執行并且打印「runningrunningrunning」

    13.

    Click the Exhibit button.

    Which two are possible results?(Choose two.)

    A.0,2,4,4,6,8,10,6,

    C.0,2,4,6,8,10,12,14,

    13

    點擊展覽按鈕。 二是哪些可能的結果?(選擇二。) A.0, 2,4,4,6,8,10,6, C.0, 2,4,6,8,10,12,14,

    14.

    void waitForSignal(){

    Object obj = new Object ();

    synchronized (Thread. Current Thread ()){

    obj. wait ();

    obj. notify ();

    }

    }

    Which statement is true?

    B.

    This code may throw an lllegalStateException.

    14

    空waitForSignal () {對象obj =新的對象(); 同步(螺紋。 當前螺紋()){obj。 等待(); obj。 通報(); }}哪個聲明是真實的? B. 這個代碼也許投擲lllegalStateException。

    15.

    public class TestOne implements Runnable{

    public static void main (String [] args) throws Exception{

    t. start ();

    System .out. print ("Complete");

    }

    public void run (){

    for (int | =0; | <4;i++){

    System .out. print (i);

    }

    }

    }

    What can be a result?

    15.

    TestOne實施可追捕的公開類{公開靜止空隙主要(串[] args)投擲例外{T。 開始(); 系統.out。 印刷品(「完成」); }公眾空奔跑() {為(int | =0; | <4; i++) {系統.out。 印刷品(i); }}}什麼可以是結果?

    E.

    The code executes and prints "Started0123Complete"

    E. 代碼執行并且打印「Started0123Complet

    要先學會最基本的語法

    才知它在引述些什麼的

  • 吉他
    Lv 5
    1 decade ago

    ~冠儒~ ,這是java程式語言的專用指令,並不是亂碼,有的還是變數,不能直接用翻譯軟體翻= =,看你翻出來的很好笑…

Still have questions? Get your answers by asking now.