What is the standard way to handle Exceptions when making a Method Reference when the referenced method declares to throw an exception: Following is the pseudo-code for demonstrating the enquiry:
class Foo{
public static void foo throws Exception{
throw new Exception("some exception which would propagate up-stack");
}
}
class Bar {
public void bar(){
new Thread (Foo::foo).start(); // since Foo.foo declares to throw a checked exception; how should we handle it here? Surrounding this statement in try block on Eclipse does not solve the compiler // complain
}
}