Which statement, inserted at line 8, enables the code to compile?

Given:

Which statement, inserted at line 8, enables the code to compile?

Given:

Which statement, inserted at line 8, enables the code to compile?

A.
new Task().new Counter().increment();

B.
new Task().Counter().increment();

C.
new Task.Counter().increment();

D.
Task.Counter().increment();

E.
Task.Counter.increment();

Explanation:



Leave a Reply 2

Your email address will not be published. Required fields are marked *


gelete

gelete

C.

OCA/OCP Java SE 7 Programmer I & II Study Guide (Kathy Sierra, Bert Bates)
699 Static Nested Classes
700 Instantiating and Using Static Nested Classes

class BigOuter {
static class Nest {void go() { System.out.println(“hi”); } }
}

class Broom {
public static void main(String[] args) {
BigOuter.Nest n = new BigOuter.Nest(); // both class names
}
}