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

Ramasubramaniam's blog

Ramasubramaniam's picture

Java Command Line Arguments Tutorial

3
Your rating: None Average: 3 (2 votes)
Command line arguments
All java applications contain a static method called main. Signature of the main method is as given below
 
public static void main(String[] args)
 
Ramasubramaniam's picture

Convert char to Integer example

1
Your rating: None Average: 1 (2 votes)
  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. }
Ramasubramaniam's picture

Convert char to int ASCII example

0
Your rating: None
  1. /*
  2.  * Convert char to int ASCII example. Program to convert char
  3.  * to int ASCII number.
  4.  */
  5.  
  6. public class CharToInt {
  7.  
  8.  public static void main(String args[]){
  9.  
  10.   char ch = 'a';
  11.    
  12.   //cast the character to convert it to int
  13.   int asciiCode = (int)ch;
  14.    
  15.   System.out.println("char converted to int ascii code: " + asciiCode);
  16.  
  17.  }
  18.  
  19. }
Syndicate content