向上转型后的问题

import java.io.IOException;
import java.io.OutputStream;

public class SystemDemo01 {
    public static void main(String[] args) {
        OutputStream out = System.out; //向上转型后丢失子类方法?
        System.out.println("eeeeee");
        try {
            System.out.write("jijiji ".getBytes());
        } catch (IOException e1) {
            e1.printStackTrace();
        }
        try {
            out.write("My little apple!!!!".getBytes());
        } catch (IOException e) {
            e.printStackTrace();
        }
        try {
            out.close();
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}

原文地址:https://www.cnblogs.com/vonk/p/3921961.html