Online Java Compiler By
JavaTpoint.com
public class StringToCharExample1{ public static void main(String args[]){ String s="hello"; char c=s.charAt(0);//returns h System.out.println("1st character is: "+c); }}
Output