The String Constructors in Java

The String class supports several constructors. To create an empty String, we call the default constructor String s = new String(); Example char chars[] = { ‘a’, ‘b’, ‘c’ };String s = new String(chars); This constructor initializes s with the string “abc” Construct one String from another The output from this program JavaJava Construct string … Read more