JAVA多态调用案例代码
来源:互联网 发布:安居客网络经纪人 编辑:程序博客网 时间:2024/06/07 20:33
/*
*title:JAVA多态调用演示类代码
*author:chinayaosir
*IDE:JDeveloper version 10.1.1
*function:excel quotesheet with warmart/kmart/cvs sample code
*/
---------------------------------------------------------------------------------
/*
* filename:basicqs.java
*/
package userinterfacejsp;
public class basicqs{
public void GetExcelset( ) {
System.out.println("pls set excel column set!");
}
public void GetExcelFile( ) {
System.out.println("pls set excel file path!");
}
public void savetoExcel( ) {
System.out.println("pls set excel data!");
}
}
---------------------------------------------------------------------------------
/*
* filename:warmart.java
*/
package userinterfacejsp;
class warmart extends basicqs{
public void GetExcelset( ) {
System.out.println("get excel column set from database table!");
}
public void GetExcelFile( ) {
System.out.println("******Warmark quotesheet******************************");
System.out.println("excel file= warmark.xls");
}
public void savetoExcel( ) {
System.out.println("write quotesheet with 120 column data and one photo!");
System.out.println("write attahchment with 20 coloumn data");
System.out.println("write hangtag with 10 coloumn data");
}
}
---------------------------------------------------------------------------------
/*
* filename:kmart.java
*/
package userinterfacejsp;
class kmart extends basicqs{
public void GetExcelset( ) {
System.out.println("get excel column set from database table!");
}
public void GetExcelFile( ) {
System.out.println("******Kmark quotesheet********************************");
System.out.println("excel file= kmark.xls");
}
public void savetoExcel( ) {
System.out.println("write quotesheet with 100 column data and one photo!");
System.out.println("write attahchment with 10 coloumn data");
}
}
---------------------------------------------------------------------------------
/*
* filename:cvs.java
*/
package userinterfacejsp;
class cvs extends basicqs{
public void GetExcelset( ) {
System.out.println("get excel column set from database table!");
}
public void GetExcelFile( ) {
System.out.println("******Warmark quotesheet******************************");
System.out.println("excel file= cvs.xls");
}
public void savetoExcel( ) {
System.out.println("write quotesheet with 50 column data and one photo!");
}
}
---------------------------------------------------------------------------------
/*
* filename:printqs.java
*/
package userinterfacejsp;
public class printqs{
public void excel(basicqs temp){
temp.GetExcelFile();
temp.GetExcelset();
temp.savetoExcel();
}
public static void main(String args[]) {
printqs p=new printqs();
kmart k=new kmart();
warmart w=new warmart();
cvs c=new cvs();
p.excel(k);
p.excel(w);
p.excel(c);
}
}
---------------------------------------------------------------------------------
program run values:
******Kmark quotesheet********************************
excel file= kmark.xls
get excel column set from database table!
write quotesheet with 100 column data and one photo!
write attahchment with 10 coloumn data
******Warmark quotesheet******************************
excel file= warmark.xls
get excel column set from database table!
write quotesheet with 120 column data and one photo!
write attahchment with 20 coloumn data
write hangtag with 10 coloumn data
******Warmark quotesheet******************************
excel file= cvs.xls
get excel column set from database table!
write quotesheet with 50 column data and one photo!
- JAVA多态调用案例代码
- java调用天气预报案例
- 沪深股市api调用代码案例
- Java email 案例代码
- java枚举代码案例
- Solr单集代码调用案例
- Hadoop-rpc调用案例,服务端,客户端代码案例
- java正则表达式-案例代码
- Java对象数组代码案例
- Java开发Struts2案例代码
- java代码MD5加密案例
- Java代码SHA1加密案例
- Java多态案例分析
- Java代码压缩文件夹及多文件压缩---简单案例
- Java中的多态调用问题,下面代码输出是什么?
- Java中的多态调用问题,下面代码输出是什么?
- Java中的多态调用问题,下面代码输出是什么?
- java调用天气预报调用代码
- FBX 资源
- vs2008 创建自定义任务批处理webpart
- 開発環境のMySQLを4系から5系に変更する方法(开发环境 升级MySQL4到MySQL5)
- C标准库源码解剖(1):类型相关的定义
- api
- JAVA多态调用案例代码
- AssertValid和Dump函数的应用
- c语言位域
- eclipse下安装Extjs的插件spket
- NHibernate教程1
- 客户端软件的设置方法
- 警告: No configuration found for the specified action: '/myNameSpace/login.action' in names
- 测试概述
- DCL小结