• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Paul Clapham
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Roland Mueller
  • Piet Souris
Bartenders:

Regarding 'char'

 
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
what would b printed in the console when printing using System.ou.println();

char c = \u0033;
System.ou.println(c);


char c = 65535;
System.ou.println(c);


char c = 0xffff;
System.out.println(c);


char c = 889;
System.ou.println(c);


what wil b the output of each one.
plz help me on this... bcoz what ever the first c i get '.' and if i print the other three i get '?'
 
Ranch Hand
Posts: 63
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Try putting the unicode value in ''. It will print "3"
About the rest, anything over 127 cannot be resolved because there is no character assigned to it(I think), so println will print "?".
 
reply
    Bookmark Topic Watch Topic
  • New Topic