public
String(char value[])
Allocates
a new String so that it represents the sequence of characters
currently contained in the character array argument.
class StringConstructor8{ public static void main(String args[]){ char data[] = {'a', 'b', 'c', 'd'}; String s1; s1 = new String(data); System.out.println(s1); } }
Output
abcd
No comments:
Post a Comment