String Construction Using Char Array In Java Example
Chapter:
String Handling
Last Updated:
15-07-2016 11:09:41 UTC
Program:
/* ............... START ............... */
public class JavaStringCharArray {
public static void main(String args[]) {
char c[] = { 'J', 'a', 'v', 'a' };
String s1 = new String(c);
String s2 = new String(s1);
System.out.println(s1);
System.out.println(s2);
}
}
/* ............... END ............... */
Output
Notes:
-
String construction using the char array with specific characters.
Tags
Char Array, Java