EssayTemplate.java 599 B

12345678910111213141516171819202122232425
  1. package J20250725;
  2. import java.io.FileNotFoundException;
  3. import java.io.FileOutputStream;
  4. import java.io.IOException;
  5. /**
  6. * @author WanJl
  7. * @version 1.0
  8. * @title EssayTemplate
  9. * @description
  10. * @create 2025/7/16
  11. */
  12. public abstract class EssayTemplate {
  13. public String write() throws IOException {
  14. StringBuilder sb=new StringBuilder();
  15. sb.append("《我的爸爸》");
  16. sb.append("\r\n");
  17. sb.append(body());
  18. sb.append("\r\n");
  19. sb.append("啊~这就是我的爸爸!");
  20. return sb.toString();
  21. }
  22. public abstract String body();
  23. }