Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Ques from ((khalid mughal)) very Confusing?

 
Ajay Singhal
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi!
I'm getting a problem in one simple Ques.
Select all valid answers?
1)char a='\u0061';
2)char \u0061='a';
3)ch\u0061r a='a';
ans : All are valid!!
------------------
 
Sahir Shah
Ranch Hand
Posts: 158
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ajay,
If I am not mistaken char a='\u0061'; does not confuse you. I was sorely tempted to give you the answer straightaway, but , since Khalid has gone to so much trouble to create a question which is so fiendish and yet so simple I cannot give you the answer. However I shall give you a hint.
\u0063h\u0061r r = 'x';
Is also valid. Compile it and see for yourself.
I like this question. Its so
Cheers
Sahir

sahirshah@emirates.com

www.geocities.com/sahirshah

[This message has been edited by Sahir Shah (edited January 13, 2001).]
 
Jane Griscti
Ranch Hand
Posts: 3141
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi ..
I'm closing this thread ... see duplicate post and answers in http://www.javaranch.com/ubb/Forum24/HTML/007246.html
Jane
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic