现在的位置: 首页 > 综合 > 正文

白云黑土

2013年12月07日 ⁄ 综合 ⁄ 共 933字 ⁄ 字号 评论关闭
package diliuzhang;

public class Advertisementboard {//创建广告牌
	public void show(Advertisment adver){
		System.out.println(adver.getcorpname()+"的广告词如下");
		adver.showAdvertisment();
		
	}

}

package diliuzhang;

public abstract class Advertisment {
    public void show();
    public String getcorpname();
    

}

package diliuzhang;

public class Blacklandcorp implements Advertisment{
	public void show(){
		System.out.println("&&&&&&&&&&&&&");
		System.out.println("劳动是爹!土地是妈!");
		System.out.println("&&&&&&&&&&&&&");	
	
	}
	public String getcorpname(){
		return "黑土集团";
	}

}

package diliuzhang;

public class Test {
	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Advertisementboard board=new Advertisementboard();
		board.show(new Blacklandcorp());
		board.show(new Whitecloudcorp());

	}

}

package diliuzhang;

public class Whitecloudcorp implements Advertisment{
	public void show(){
		System.out.println("@@@@@@@@@@@@@");
		System.out.println("飞机中的战斗机,爱yes!");
		System.out.println("@@@@@@@@@@@@@");	
	
	}
	public String getcorpname(){
		return "白云公司";
	}

}

抱歉!评论已关闭.