Privacy Policy Terms Of Use. Copyright © 2006-2010 Java Tutorials and Examples.
Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other names may be trademarks of their respective owners.
- /*
- * Convert String to char example. Program to convert String
- * to char.
- */
- public class StringToChar {
- public static void main(String args[]){
- String strCh = "h";
- //to convert String to char use charAt method of String class.
- char ch = strCh.charAt(0);
- System.out.println("String converted to char: " + ch);
- }
- }

Post new comment