本帖最后由 adamjy 于 2014-4-22 12:40 编辑
代码如下,
- public class Demo extends DataInputStream{
- public Demo(InputStream in) {
- super(in);
- // TODO Auto-generated constructor stub
- }
- public static void main(String[] args) throws Exception {
- new Demo(null).printName();
- }
- public void printName() {
- System.out.println(super.getClass().getSimpleName());
- }
-
- }
复制代码
//output: Demo
问题:为什么打印结果不是 DataInputStream、 |