0 votes
in JAVA by
Name 5 IO best practices?

1 Answer

0 votes
by

IO is very important for performance of your Java application. Ideally you should avoid IO in critical path of your application. Here are couple of Java IO best practices you can follow:

a) Use buffered IO classes instead of reading individual bytes and char.

b) Use classes from NIO and NIO2

c) Always close streams in finally block or use try-with-resource statements.

d) use memory mapped file for faster IO.

If a Java candidate doesn't know about IO and NIO, especially if he has at least 2 to 4 years of experience, he needs some reading.

Related questions

0 votes
asked Jan 27, 2020 in JAVA by rahuljain1
0 votes
asked Oct 10, 2020 in JAVA by Robindeniel
...