作者: 赫骏 时间: 2012-10-29 01:04
选择D , 因为P2不能够找到P1,用public,private等限定一下就可以了 p2.afancymethod();p2找不到这个方法作者: 林志进 时间: 2012-10-29 01:10
看JDK的版本了,1.4之前是可以编译的。官方给出的说明:
The compiler now rejects import statements that import a type from the unnamed namespace. Previous versions of the compiler would accept such import declarations, even though they were arguably not allowed by the language (because the type name appearing in the import clause is not in scope). The specification is being clarified to state clearly that you cannot have a simple name in an import statement, nor can you import from the unnamed namespace.作者: 张其辉 时间: 2012-10-29 01:30
我试了下,结果是A