wood burning stoves 2.0*
The moose likes Beginning Java and the fly likes convert Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "convert " Watch "convert " New topic
Author

convert

shirsa ray chaudhuri
Greenhorn

Joined: Apr 08, 2008
Posts: 10
int i=(int)c;

where char c='a';

is it write
Ravinder Partap
Greenhorn

Joined: Feb 03, 2008
Posts: 8
this is fine, but you could avoid the explicit casting as its done implecitly while widening 16 bit char to 32 bit int primitive.
int i= (int)c;
is equal to :
int i = c;
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: convert
 
Similar Threads
Get Unicode of a character
Get Ascii value for a character
int c=1; c=c++; // c is then 1 not 2 !
Comparable again
int []c[] = new int [4][6]; is it a correct syntax ?