Demo entry 6780136

C1P5

   

Submitted by anonymous on Dec 23, 2018 at 08:10
Language: Java. Code size: 475 Bytes.

import java.io.FileWriter;
import java.io.IOException;
import java.util.Scanner;

class Scratch {
    public static void main(String[] args) throws IOException {
        Scanner scanner = new Scanner(System.in);
        System.out.println("Please Input something:");
        FileWriter fileWriter = new FileWriter("test.txt");
        String line = scanner.nextLine();
        fileWriter.write(line);
        scanner.close();
        fileWriter.close();
    }
}

This snippet took 0.00 seconds to highlight.

Back to the Entry List or Home.

Delete this entry (admin only).