About Question enthuware.ocpjp.v7.2.1774 :
Posted: Sun Aug 21, 2016 6:27 am
Why would it throw exception while reading if default enconding is UTF?Although writeChars(String ) is a valid method in RandomAccessFile, it is not suitable here because you want to read the contents in UTF format later. writeChars will write the String is default encoding and if you try to read it as UTF, it will throw an exception while reading.