Char to string in java

(Last Updated On: May 22, 2013)

Program:

package com.javadomain.in;

public class ChartoString {

	public static void main(String[] args) {
		String input = "javadomain";
		char input_char = input.charAt(9);
		String chartostr = Character.toString(input_char);
		System.out.println("String input :"+input);
		System.out.println("String to char : "+input_char);
		System.out.println("char input:" +input_char);
		System.out.println("char to string :"+ chartostr);
	}

}

 

Output:

String input :javadomain
String to char : n
char input:n
char to string :n

 

 

Thanks for reading this post…….!!!.

224 total views, 0 views today

Leave a Reply

Your email address will not be published. Required fields are marked *