Rajinder Menu

How to convert a char to ascii value in Java.


Following example shows how to convert a char to its ascii value.

public class AsciiValue{
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