Client Login Register
Calculate Price & Order →
← Back to all articles

help me

Published on November 30, 2026 • Category: General Tips
help me

help me

Write a program that reads a file and create a file with contents lower case

import java.io.*;

public class InputOutput
{

public static void main(String[] args) throws FileNotFoundException, IOException
{
File file1 = new File("inputfile.txt");
File file2 = new File("outputfile.txt");
BufferedReader in = (new BufferedReader(new FileReader(file1)));
PrintWriter out = (new PrintWriter(new FileWriter(file2)));

int ch;
while ((ch = in.read()) != -1)
{
if (Character.isUpperCase(ch))
{
ch = Character.toLowerCase(ch);
}
out.write(ch);
}

in.close();
out.close();

have created a program but it will not compile or execute. Could someone fix the program?






Share

We only email you; unsubscribe in one click. No address is ever sold.

⚡ Order Now 💬 WhatsApp 📞

Just now