• 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
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Frits Walraven
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • salvin francis
  • fred rosenberger

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
 
Clowns were never meant to be THAT big! We must destroy it with this tiny ad:
Devious Experiments for a Truly Passive Greenhouse!
https://www.kickstarter.com/projects/paulwheaton/greenhouse-1
    Bookmark Topic Watch Topic
  • New Topic