File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how to initialize char??

 
yuvraj kotegar
Ranch Hand
Posts: 120
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
how to initialize it?

like string is null int is 0

how about char?
 
Joe Ess
Bartender
Posts: 9214
9
Linux Mac OS X Windows
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Have a look at The Java Tutorial: Primitive Data Types.
 
yuvraj kotegar
Ranch Hand
Posts: 120
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
char '\u0000' its given there!!!

how about simple programs ??
 
Campbell Ritchie
Sheriff
Pie
Posts: 47244
52
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
'\u0000' is a valid char. Its bit value is 0000_0000_0000_0000, and it is called the null character. You can find it on this Unicode chart.

You initialise a char exactly the same way you initialise anything else; put it to the left of an assignment operator (=) and put a char literal or an expression which is convertible to a char on the right of that, then a ; sign.
 
Consider Paul's rocket mass heater.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic