5 changed files with 20 additions and 0 deletions
Binary file not shown.
Binary file not shown.
@ -0,0 +1,6 @@ |
|||||
|
public class PdfReport implements ReportInter{ |
||||
|
@Override |
||||
|
public void generate() { |
||||
|
System.out.println("生成PDF报表"); |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,4 @@ |
|||||
|
|
||||
|
public interface ReportInter { |
||||
|
void generate(); |
||||
|
} |
||||
@ -0,0 +1,10 @@ |
|||||
|
public class TestReport { |
||||
|
public static void main(String[] args) { |
||||
|
// 多态调用
|
||||
|
ReportInter r1 = new PdfReport(); |
||||
|
r1.generate(); |
||||
|
|
||||
|
ReportInter r2 = new ExcelReport(); |
||||
|
r2.generate(); |
||||
|
} |
||||
|
} |
||||
Loading…
Reference in new issue