Skip to content

Commit 1594188

Browse files
committed
issue 21
1 parent 40a3130 commit 1594188

1 file changed

Lines changed: 10 additions & 7 deletions

File tree

‎koans/src/intermediate/AboutInnerClasses.java‎

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@
55

66
import com.sandwich.koan.Koan;
77

8-
interface Ignorable {
9-
String ignoreAll();
10-
}
11-
128
public class AboutInnerClasses {
139

10+
interface Ignoreable {
11+
String ignoreAll();
12+
}
13+
1414
class Inner {
1515
public String doStuff() { return "stuff"; }
1616
public int returnOuter() { return x; }
@@ -76,12 +76,15 @@ public void creatingAnonymousInnerClasses() {
7676
assertEquals(anonymous.theAnswer(), __);
7777
}
7878

79-
@SuppressWarnings("null")
8079
@Koan
8180
public void creatingAnonymousInnerClassesToImplementInterface() {
82-
Ignorable ignorable = null; // Complete the code so that the statement below is correct.
81+
Ignoreable ignoreable = new Ignoreable(){
82+
public String ignoreAll() {
83+
return null;
84+
}
85+
}; // Complete the code so that the statement below is correct.
8386
// Look at the koan above for inspiration
84-
assertEquals(ignorable.ignoreAll(), "SomeInterestingString");
87+
assertEquals(ignoreable.ignoreAll(), "SomeInterestingString");
8588
// Did you just created an object of an interface type?
8689
// Or did you create a class that implemented this interface and
8790
// an object of that type?

0 commit comments

Comments
 (0)