Writing to a file simply means modifying the existing information in a file

import java.io*

class Files {
	public static void main(String[]args){
		
		//writing to files 
		try{
			BufferedWriter bw = new BufferedWriter(
			new FileWriter("C: \\\\Users \\\\sreza\\\\Desktop\\\\Test\\\\output.txt"));
			//change so that it works on computer 

			bw.write("ms katsman kinda whack\\n");
			bw.write("facts bro i agree");
			bw.close();
	
		} catch(IOException ex){
				System.out.println("sum up with input or output we donn really kno");
				System.out.println("IOException: " + ex.getMessage());
				return;
		} catch(FileNotFoundException ex){
				System.out.println("we cant find ur file bro");
				System.out.println("FileNotFoundException" + ex.getMessage());
		}

	}
}

Reading from a file simply means reading whatever data is stored in the file and printing it in the console

import java.io*;

class filesMain{
		public static void main(String[]args){
				try{
					BufferedReader br = new BufferedReader(
					new FileReader("C: \\\\Users \\\\sreza\\\\Desktop\\\\Test\\\\output.txt"));
					
					String s;
					while((s = br.readLine()) != null){
							System.out.println(s);
					}

					br.close();

				} catch{
						return;
				}

		}
}

Menu

  1. read data
  2. overwrite data on a file
  3. exit

file io to-do