Share on Google+Share on Google+

Use char variable as integer

This tutorial demonstrate how to use the char variable as an integer.


Here in this example you will see how a char variable works like a integer. The char variable works with pre and post increment operators.


public class CharInt {
  public static void main(String args[]) {
    char charVar;
    for (charVar = 'A'; charVar <= 90; charVar++) {


Download this code


Posted on: June 26, 2010 If you enjoyed this post then why not add us on Google+? Add us to your Circles

Share this Tutorial Follow us on Twitter, or add us on Facebook or Google Plus to keep you updated with the recent trends of Java and other open source platforms.