Following example shows how to convert a char to its ascii value.
Output:
65
public class AsciiValue{
public static void main(String args[]){
char c='A';
int i=c;
System.out.println(i);
}
}
public static void main(String args[]){
char c='A';
int i=c;
System.out.println(i);
}
}
Output:
65
I would like to know your comments and if you liked the article then please share it on social networking buttons.
No comments:
Post a Comment