- abstract class Test {
- abstract void show();
- }
- class Inter
- {
- public static void inter()
- {
- new Test()
- {
- void show()
- {
- System.out.println("打印显示!");
- }
- }.show();
- }
- }
- class InnerClassTest
- {
- public static void main(String[] args)
- {
- Inter.inter();
- }
- }
- 提示的错误是:abstract class Test {
- abstract void show();
- }
- class Inter
- {
- public static void inter()
- {
- new Test()
- {
- void show()
- {
- System.out.println("打印显示!");
- }
- }.show();
-
- }
- }
- class InnerClassTest
- {
- public static void main(String[] args)
- {
- Inter.inter();
- }
- }
复制代码 |