aspose file tools*
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
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: 8710
    
    6

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: 36508
    
  16
'\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??
 
Similar Threads
char question from khalid mughal exam
Char Conversion
convert String to char
Integer to Char output question
Doubt in Array