I have seen some people talking about it and my question is...

I have a program that opens a input and output stream,
when the program gets the message '#end' it should terminate the program.

Does it really matter if I close the in-and output streams and then close the program or if I just do a System.exit() ?
Everything will be closed and released anyway?

If you do a System.exit your program will terminate immediately and any unflushed buffers will be discarded, and any system resources you are holding may not be released. You should use try/catch/finally to ensure files and closed and resources released, and ideally allow your program to terminate normally by finishing all your threads.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.20 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.