import java.io.FileWriter;
import java.io.IOException;

/**
 * Project: Hello World Variations
 * Author: Molla Samser
 * Company: RSK World
 * Website: https://rskworld.in
 * Contact: +91 93305 39277
 * Support: help@rskworld.in
 * Year: 2026
 * 
 * Description: Writes "Hello World" to a file named 'hello.txt'.
 */

public class FileHelloWorld {
    public static void main(String[] args) {
        String content = "Hello World! This file was generated by RSK World project.";
        String fileName = "hello.txt";

        try (FileWriter writer = new FileWriter(fileName)) {
            writer.write(content);
            System.out.println("Successfully wrote to " + fileName);
            System.out.println("Content: " + content);
        } catch (IOException e) {
            System.out.println("An error occurred during file writing.");
            e.printStackTrace();
        }
    }
}
