首页 > 编程语言 > 详细

死磕java(7)

时间:2015-03-28 23:06:18      阅读:330      评论:0      收藏:0      [点我收藏+]

http://www.cnblogs.com/liunanjava/p/4296045.html

 

自己写的例子

package com.sougn.trynew;

public abstract class AbstractTry {

 private int id;  private String name;    public abstract void say();    public void say2()  {   System.out.print("hello word");  } }

package com.sougn.trynew;

public class AbstractTry2 extends AbstractTry{

 public void say()  {   System.out.print("abstract hello word");  } }

package com.sougn.trynew;

public interface  interfacetry {

public void say();

public void sayInterface();   }

package com.sougn.trynew;

public class interfacetry2 implements interfacetry{

 public void say()  {   System.out.print("hello word");  }    public void sayInterface()  {   System.out.print("interfaceTry2");  } }

package com.sougn.trynew;

public interface  interfacetry3 extends interfacetry{

 public void say3(); }

package com.sougn.trynew;

public class trynew {

 public static void main(String[] args) {   // TODO Auto-generated method stub   AbstractTry2 abstractTry = new AbstractTry2();   abstractTry.say();   abstractTry.say2();      interfacetry2 interfacetry2 = new interfacetry2();   interfacetry2.sayInterface();

 }

}

死磕java(7)

原文:http://www.cnblogs.com/ututuut/p/4374940.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!