zoukankan      html  css  js  c++  java
  • implsments

    package study.itest;

    public interface IOne {

     public String getString();
    }
    ----------------------------------
    package study.itest;

    public class Two implements IOne {

     @Override
     public String getString() {
      return this.getClass().getName();
     }

    }
    ----------------------------------
    package study.itest;

    public class Three implements IOne {

     @Override
     public String getString() {
      return this.getClass().getName();
     }

    }
    ----------------------------------
    package study.itest;

    public class Output {

     public static void Show(IOne one) {
      System.out.println("Show:" + one.getString());
     }

     public static void main(String[] args) {
      IOne one = null;
      one = new Two();
      Show(one);
      one = new Three();
      Show(one);
     }
    }


     

  • 相关阅读:
    emacs command
    emacs format
    attach
    虚拟ip
    emacs redo
    mariadb
    unsafe
    select, poll, epoll
    03基于python玩转人工智能最火框架之TensorFlow介绍
    03SQL语句
  • 原文地址:https://www.cnblogs.com/xinxindiandeng/p/1358718.html
Copyright © 2011-2022 走看看