package Relect;
/*要求:补齐代码,输出helloworld
*/
interface Inter
{
void show();
}
class Outer
{
public static Inter method()
{
return new Inter(){public void show(){System.out.println("helloworld");}};
}
//补齐代码,可以写两种形式,虽然基础班不做过多要求,但是感觉蛮有用的...
//做过的就算了,没做过的代码不用急着写,先看看自己有没有思路。。
}
public class Text
{
public static void main(String[] args){
Outer.method().show();
}
} |