This week's book giveaway is in the Agile and Other Processes forum.
We're giving away four copies of Real-World Software Development: A Project-Driven Guide to Fundamentals in Java and have Dr. Raoul-Gabriel Urma & Richard Warburton on-line!
See this thread for details.
Win a copy of Real-World Software Development: A Project-Driven Guide to Fundamentals in Java this week in the Agile and Other Processes forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Liutauras Vilda
  • Knute Snortum
  • Bear Bibeault
Sheriffs:
  • Devaka Cooray
  • Jeanne Boyarsky
  • Junilu Lacar
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
  • salvin francis
Bartenders:
  • Tim Holloway
  • Piet Souris
  • Frits Walraven

Unicode

 
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I need a help. Thannks in advance.
Which of the following lines are valid declarations?
Select all valid answers.
a). char a='\u0061';
b) char \u0061='a';
c) char\u0061r a='a';
 
Ranch Hand
Posts: 112
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Originally posted by Rex Rodriguez:
I need a help. Thannks in advance.
Which of the following lines are valid declarations?
Select all valid answers.
a). char a='\u0061';
b) char \u0061='a';
c) char\u0061r a='a';


a and b are valid. but if c would have written like ch\u0061r a='a'; then even that would have been right. What happens here is at compile time unicode characters are translated first
 
Rex Rodriguez
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
<<but if c would have written like ch\u0061r a='a'; then even that would have been right.>>
What is the conceptual basis for this? I am trying to learn and understand.
 
Arathi Rajashekar
Ranch Hand
Posts: 112
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Originally posted by Rex Rodriguez:
<<but if c would have written like ch\u0061r a='a'; then even that would have been right.>>
What is the conceptual basis for this? I am trying to learn and understand.


The concept here is while writing the program you can use unicode charcters also. Still you want some detail, frame the question and post. I will try to answer as much as possible
 
Rex Rodriguez
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I understand that one can use unicode character. I was reading RHE book and he has an example something like this:
char='\u0000'
This is clear. I am not clear about the position of \u0000. Can we use \u0000 anywhere like char\u0000='a' so on and so forth. If yes, then what is the rule of the position.
Thanks for your help in advance.
 
You have to be odd to be #1 - Seuss. An odd little ad:
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!