Example For charValue() method in java

Example For charValue() method in java


Posted in : Core Java Posted on : October 1, 2010 at 12:41 PM Comments : [ 0 ]

In this Example, We will Introduced you about the charValue() method of the character class.

Example For charValue() method in java

In this Example, We will Introduced you about the charValue() method of the character class.  This method returns the Value of the character object. This method is used with the character object followed by .(dot) operator.

Example: CharacterValue.java

package com.devmanuals;

public class Charactervalue {

	public static void main(String[] args) {
		Character ch1 = new Character('A');
		Character ch2 = new Character('B');
		System.out.print("The character value of ch1 is= ");
		System.out.println(ch1.charValue());
		System.out.print("The character value of ch2 is= ");
		System.out.println(ch2.charValue());

	}

}

Output:

The character value of ch1 is= A

The character value of ch2 is= B

Download This Example.

Go to Topic «PreviousHomeNext»

Your Comment:


Your Name (*) :
Your Email :
Subject (*):
Your Comment (*):
  Reload Image
 
 

 
Tutorial Topics