Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JQPlus I/O question

 
Micah Holroyd
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Which of the following encoding schemes is used by the jvm internally for storing identifiers, etc?
a) Unicode
b) UTF8
c) ASCII
d) 8859-1
e) it depends on the platform
The listed answer is b, but I was almost certain the answer was a. If a is not the right answer, why not?
 
Fawad Khan
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well ! for certification u must keep in mind that INTERNALLY the JVM stores as UTF8, the reason being the universality of the UTF as the name suggests. And by the way jsy start believing JQ+ as it is the best tool for certification.
 
Micah Holroyd
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for your reply Fawad. However I'm still a little confused. In Mughal's book (pg. 567) it says,
"Java programs represent characters internally in the 16-bit Unicode character encoding, but the host platform might use another character encoding to represent characters externally."
To me, this is saying that Unicode is used internally. Am I not understanding this quote correctly?
 
Paul Anilprem
Enthuware Software Support
Ranch Hand
Posts: 3711
10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Internally Java uses UTF8 for string literals, identifiers etc because this format is more compact. Unicode chars always require 2 bytes to store any char but UTF8 takes only 1 byte to store standard ASCII chars.
HTH,
Paul.

------------------
Get Certified, Guaranteed!
(Now Revised for the new Pattern)
www.enthuware.com/jqplus

Your guide to SCJD exam!
www.enthuware.com/jdevplus
Try out the world's only WebCompiler!
www.jdiscuss.com
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic