I wrote a small application in java that writes several lines to a text file every ten seconds or so. Is it better to initialize the input stream outside the loop and keep it open for a very long time, or open and close it every time I need to use it?
I donβt think it really matters in this example, since it is such a slow cycle, but I would like to know only about future calls. What about an identical script, but associated with a JDBC connection? ..
Many thanks.
source
share