码迷,mamicode.com
首页 > 编程语言 > 详细

死磕java(7)

时间:2015-03-28 23:09:08      阅读:195      评论: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
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!