Exercise (Solutions)

E1

Study the below class:


class MyClass {

    public static void main(String[] args) {
        System.out.println("Hello World");
    }
}

Observe the indentation for System.out.println statement. Figure out why it has two tab indentation. Explain your answer.

E2

What is wrong with this class definition?

class MySecondClass (

)

E3

What is wrong with this class definition?

classMyThirdClass {

}

E4

What is wrong with this method definition?

mymethodname {

}

E5

What method must every application program have, to run as a standalone program?

E6

What must a statement end with?

results matching ""

    No results matching ""