• 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
  • Liutauras Vilda
  • Bear Bibeault
  • Paul Clapham
  • Jeanne Boyarsky
Sheriffs:
  • Junilu Lacar
  • Knute Snortum
  • Henry Wong
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Frits Walraven
  • Joe Ess
  • salvin francis

khailds question on char declaration

 
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi
accordin to khalids book , in chp 2 Q2.5 it says
which r valid declarations ??
select all valid answers..
a. char a='\u0081';
b. char \u0061='a';
c. ch\u0061r='a';
it says all answers r valid.
i understood the a answer
can u declare a char variable like in b and c options above.
i thgt variable names could not contain \.
pls throw some light on this .
thx
Kamal
 
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi there,
yeah, the Unicode characters can appear in the source code.
like:
ch\u0061r a = 'a'; => char a = 'a';
char \u0062 = 'b'; => char b = 'b';
char c = '\u0063'; => char c = 'c';
you can also check Velmurugan Periasamy's webside.. check the FAQ or mocklist from javaranch's website, also back to p.24~25 from Khalid Table 2.7.
hope this help. good day.
martha
 
I miss the old days when I would think up a sinister scheme for world domination and you would show a little emotional support. So just look at this tiny 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!