class NiMingTest
{
public static void main(String[] args)
{
Student s = new Student();
s.speak();
new Student().speak(); //匿名函数
Test t = new Test();
t.test1(); // ???
// t.test1(new Student());
}
}
class Student
{
public void speak()
{
System.out.println("student++++++show");
}
}
class Test
{
public void test1(Student s)
{
s.speak();
}
} |
|