• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

mock question regarding internationalization?

 
yamini nadella
Ranch Hand
Posts: 257
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
which of the following are used in internationalization?
(A) java.lang.Long class
(B) java.lang.Float class
(c) java.lang.String class
(d) java.Lang.Number class
(e) char primitive class

it seems answer is C,E. According to my idea C is fine but how come E is correct. char is a primitive variable but not a class?
 
Peer Reynders
Bartender
Posts: 2968
6
 
Santosh Pasupuleti
Ranch Hand
Posts: 97
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
According to Mark Cade book it is String (c). I wonder why it includes char (primitive). Is it because it covers UTF-8 and other formats?
 
Peer Reynders
Bartender
Posts: 2968
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It is a common misconception that a Java (16 bit) char's can represent every conceivable Unicode character - it cannot. Calling chars characters is a misnomer from the old C days when ASCII was used in favor over EBCDIC. The 16 bit word (two bytes) can only represent a codepoint, which happens to be enough to represent most characters in some languages - however the use of multi-codepoint surrogate pairs and combining character sequences is still necessary for some languages and is an issue when using the char primitive type in a world-ready/internationalized application.

Originally posted by yamini nadella:
char is a primitive variable but not a class?


True - however you have to consider the source of your questions - the answers have been wrong before - why should the questions be perfect?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic