My code wont run because of something I had written in my code. what should I do to solve this?

IN my java code, i wrote functions in order to write data into a txt file and delete from it. the code just stopped running for some reason. I think it is in this file of code. Please send any tips.This is my code. if nothing is wrong with this file, please tell me.

import java.util.*;
import java.util.regex.Pattern;
import java.time.*;
import java.io.*;
import java.text.*;
import java.time.temporal.ChronoUnit;
import java.nio.file.Files;
import java.nio.file.Paths;

public class input{
public LocalDate date1;

  public input (LocalDate date1){
    this.date1=date1;
  }

  public void getSubject(){
    try{

      long count= Files.lines(Paths.get("savedata.txt")).count();
      Scanner scanner= new Scanner(System.in);
      System.out.println("When you are done entering homework, enter 'done' at subject");

      FileWriter savedata = new FileWriter("savedata.txt", true);
      PrintWriter writer = new PrintWriter(savedata);


      Homework homework1= new Homework("empty", "2024-08-24");


      System.out.println("Enter the subject of the homework");
      homework1.subject= scanner.nextLine();


      if(homework1.subject.equals("done")){

        return;
      }




    writer.println(homework1.subject);

      writer.close();
    }catch(Exception c){

    }
  }

  public void getDate() throws ParseException{

    try{




      long count= Files.lines(Paths.get("savedata.txt")).count();
      Scanner scanner= new Scanner(System.in);

      Scanner readlines = new Scanner("savedata.txt");
    FileWriter savedata = new FileWriter("savedata.txt", true);
    PrintWriter writer = new PrintWriter(savedata);
    Homework homework1= new Homework("empty","2024-08-24" );

    //LocalDate.now()

    System.out.println("Enter the due date of the homework: YYYY-MM-DD");
    homework1.dueDate= scanner.nextLine();

    //LocalDate.parse

      while(homework1.dueDate!="done"){
        writer.println(homework1.dueDate);
        break;
      }

    while(homework1.dueDate.equals("done")){
      File oldfile = new File("savedata.txt");
      File newfile = new File("temp.txt");

      int line=0;
      String currentline;
      FileWriter fw= new FileWriter("temp.txt");
      BufferedWriter bw =new BufferedWriter(fw);
      PrintWriter pw= new PrintWriter(bw);

      FileReader fr= new FileReader("savedata.txt");
      BufferedReader br = new BufferedReader(fr);

      while((currentline=br.readLine())!=null){
        line++;
        if(count!=line){
          pw.println(currentline);
        }
      }

      pw.flush();
      pw.close();
      br.close();
      fw.close();
      bw.close();
      fr.close();

      oldfile.delete();
      File dump=new File("savedata.txt");
      newfile.renameTo(dump);

      break;
     }



       writer.close();




  }catch(Exception c){

  }


}

public void getArray(){
try{
  long count= Files.lines(Paths.get("savedata.txt")).count();
    Scanner scanner= new Scanner(System.in);
    FileWriter savedata = new FileWriter("savedata.txt", true);
   PrintWriter writer = new PrintWriter(savedata);
  Homework homework1= new Homework("empty", "2024-08-24");

  System.out.println("Enter parts of homework. Write done when done.");

    String finish="";

    while(finish.equals("done")){
      File oldfile = new File("savedata.txt");
      File newfile = new File("temp.txt");

      int line=0;
      String currentline;
      FileWriter fw= new FileWriter("temp.txt");
      BufferedWriter bw =new BufferedWriter(fw);
      PrintWriter pw= new PrintWriter(bw);

      FileReader fr= new FileReader("savedata.txt");
      BufferedReader br = new BufferedReader(fr);

      while((currentline=br.readLine())!=null){
        line++;
        if((count!=line)|| (count-1!=line)){
          pw.println(currentline);
        }
      }

      pw.flush();
      pw.close();
      br.close();
      fw.close();
      bw.close();
      fr.close();

      oldfile.delete();
      File dump=new File("savedata.txt");
      newfile.renameTo(dump);

      break;
    }
    while(!finish.equals("done")) {
      finish= scanner.nextLine();
      if(!finish.equals("done")) {
        parts newpart = new parts(finish);
        homework1.addPart(newpart);
      }
      }




      System.out.println(homework1.part);

      writer.println(homework1.part);


      writer.close();
    }catch(Exception c){

    }
}
}

I was expecting my code to run normally without errors but the code runner just ends.

New contributor

Natalie Ajmeri is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật