誰可以幫我觧一下 簡單的 Java code ...

我的這提問題是這樣的....

Write Java Code to declare:

1) a local variable of data type String and name aName;

2) a field of data type boolean and name alive;

3) a class integer variable called objectNumber and initialised to 0.

誰可以幫我找一下這些答案...

謝謝...

1 Answer

Rating
  • CK
    Lv 4
    1 decade ago
    Favorite Answer

    local variable:

    public void aMethod() {

    String aName;

    }

    a field:

    class AClass {

    private boolean alive;

    }

    Integer variable:

    Integer objectNumber = new Integer(0):

    Source(s): me
Still have questions? Get your answers by asking now.