About Question enthuware.ocpjp.v7.2.1774 :

Help and support on OCA OCP Java Programmer Certification Questions
1Z0-808, 1Z0-809, 1Z0-815, 1Z0-816, 1Z0-817

Moderator: admin

Post Reply
LooksWorking
Posts: 2
Joined: Fri Oct 30, 2015 8:21 am
Contact:

About Question enthuware.ocpjp.v7.2.1774 :

Post by LooksWorking »

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.
Why would it throw exception while reading if default enconding is UTF?

admin
Site Admin
Posts: 10388
Joined: Fri Sep 10, 2010 9:26 pm
Contact:

Re: About Question enthuware.ocpjp.v7.2.1774 :

Post by admin »

It is probably not too clear from the explanation but the point that it is trying to make is that an exception will be thrown if the default encoding is different from UTF8.

HTH,
Paul.

Post Reply

Who is online

Users browsing this forum: Google [Bot] and 22 guests