Join
Blogs
Questions
Videos
Tags
Members
Search
 
 
Create your own blog, earn points and get popular!

Convert char to Integer example

  1. /*
  2.  * Convert char to Integer example. Program to convert char
  3.  * to Integer wrapper number.
  4.  */
  5.  
  6. public class CharToInteger {
  7.  
  8.  public static void main(String args[]){
  9.    
  10.    char ch = 'a';
  11.      
  12.    //user Integer constructor
  13.    Integer iObj = new Integer((int)ch);
  14.      
  15.    System.out.println("char converted to Integer: " + iObj);
  16.    
  17.  }
  18. }
Your rating: None Average: 1 (2 votes)
Share this

Post new comment

17 + 0 =
Solve this simple math problem and enter the result. E.g. for 1+3, enter 4.