zoukankan      html  css  js  c++  java
  • 向上转型后的问题

    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();
            }
        }
    }

  • 相关阅读:
    uva 10900
    uva 11181
    Codeforces Round #256 (Div. 2) Multiplication Table
    UVALive 3977
    LA 4384
    Linear Regression
    Hadoop InputFormat浅析
    codeforces 432D Prefixes and Suffixes
    php学习小记2 类与对象
    php学习小记1
  • 原文地址:https://www.cnblogs.com/vonk/p/3921961.html
Copyright © 2011-2022 走看看