Here’s a Java program to show you how to convert Char to String or vise verse.

package com.mkyong;
 
public class ConvertCharToString {
 
	public static void main(String[] args) {
 
		String website = "http://www.mkyong.com";
 
		//convert a String into char
		char charData = website.charAt(11);
		System.out.println(charData);
 
		//convert char back to String
		String temp = Character.toString(charData);
 
		if ("m".equals(temp)) {
			System.out.println("match");
		}
	}
}

Output

m
match
Tags :
Founder of Mkyong.com, love Java and open source stuff. Follow him on Twitter, or befriend him on Facebook or Google Plus. If you like my tutorials, consider making a donation to the charity, thanks.

Related Posts

Popular Posts