0

Hi,

i'm still beginner in java.

Here is my simple question:

if we have two java programs like:
-test1.java which open a file for example.
test2.java which move one file to another directory.

Suppose these two programs are working well separately.

if one day, we want to write just one program, is it possible to do it?

like Test12.java which open a file and move another file to another directory.

Hope to be clear.

thank you

4
Contributors
4
Replies
5
Views
6 Years
Discussion Span
Last Post by Neversleepin
0

I am still kind of new too but if I am not mistaken, I think you can use a buffer reader to read the contents of one file into a string variable and then use that string to write the contents into the second file. You may also be able to write to second file using the first file as a parameter...not sure how to do it but there might be a way to do that....maybe someone will have a better answer than me...good luck

0

OR you could just write a third scaffolding file which calls methods from/instantiates test1 and test2 as needed

0

Thank you appolish,

could you direct me towars an example becoze i don't get everything.
thanks

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.