Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class Test {
- public static void main(String[] args) {
- System.out.println("Enter your message");
- String userInput = new Scanner(System.in).nextLine();
- try (PrintWriter out = new PrintWriter("test.txt")) {
- out.println(userInput);
- } catch (FileNotFoundException ex) {
- }
- }
- }
Add Comment
Please, Sign In to add comment