r/javahelp • • Jun 08 '16

Need help with question

class A{
  static class B{}
  static class C{ B b;
    C(B b){this.b=b;}
    int foo(){return 42;}
  }
}
public class Exercise{

  public static void main(String [] arg){
    assert ([???].foo()==42);
  }
}

Gotta full in the ???

0 Upvotes

7 comments sorted by

View all comments

2

u/RhoOfFeh Jun 08 '16

First hint: What in the code has a thing called foo()?