File handling in java

Input and output in file :

  For taking input and produce output from a file, at first we need to create 2 text file which mean the file extension must be .txt . The file have to create in the location in which we will save our java
source code.

For example the input text file we taken is input.txt and our output file name is output.txt .We will use thous code for include them in code:

Here is the full code :

Now if we write "Hello World" in the text file named input.txt and save it. Then run the code. The output.txt file now show the same text as the text in input,txt file.
Here is the link of source file of this code. Click to download.

[Note: Please follow me, share and comment if have any question.]

0/Post a Comment/Comments