This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
The moose likes Beginning Java and the fly likes how to initialize char?? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "how to initialize char??" Watch "how to initialize char??" New topic
Author

how to initialize char??

yuvraj kotegar
Ranch Hand

Joined: Jul 31, 2008
Posts: 120
how to initialize it?

like string is null int is 0

how about char?
Joe Ess
Bartender

Joined: Oct 29, 2001
Posts: 8876
    
    8

Have a look at The Java Tutorial: Primitive Data Types.


"blabbing like a narcissistic fool with a superiority complex" ~ N.A.
[How To Ask Questions On JavaRanch]
yuvraj kotegar
Ranch Hand

Joined: Jul 31, 2008
Posts: 120
char '\u0000' its given there!!!

how about simple programs ??
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 38449
    
  23
'\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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: how to initialize char??