-3

I just simply would like to add a string to a notepad file. Let's call the notepad file "Values.txt" Say I have;

public static void main(String[] args) {

String myText = "Let's add this string to a notepad file";

// Code to add string to a notepad file

}

What would that code be?

Josh Beckwith
  • 1,432
  • 3
  • 20
  • 38
  • 2
    Have you tried anything? Google? – Magnilex Mar 22 '13 at 17:52
  • WHat research have you done? – Zachary Kniebel Mar 22 '13 at 17:52
  • 3
    No such thing as a notepad file. There are file extension. The file extension `.txt` can be opened by notepad. – Sotirios Delimanolis Mar 22 '13 at 17:53
  • Just do some searching. I found thi for you anyway [Here is the code of java program to write text to a file:](http://www.roseindia.net/java/beginners/java-write-to-file.shtml) – Smit Mar 22 '13 at 17:53
  • http://docs.oracle.com/javase/tutorial/essential/io/ to get you started. Stack Overflow is for problems you can't solve yourself easily, and easiest way to demonstrate you tried is to show some code, tell or show what it does, *and* tell how that is different from what you want. – hyde Mar 22 '13 at 17:58

1 Answers1

1

Take a look at Basic I/O tutorial. It is just manipulating a text file. All your needs should be covered there.

Jean Waghetti
  • 4,711
  • 1
  • 18
  • 28