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