
As with any other object, you can create String objects by using the new keyword and a constructor. The String class has thirteen constructors that allow you to provide the initial value of the string using different sources, such as an array of characters:
char[] helloArray = { 'h', 'e', 'l', 'l', 'o', '.'};
String helloString = new String(helloArray);
System.out.println(helloString);
The last line of this code snippet displays hello.
Could u plz explain the two statements in bold above and what these two statements mean and why is it that System.out.println(helloString) would only display hello but not helloArray.

You have declared a character array named helloArray and initialize its values with characters h,e,l,l,o and .
The statement String helloString = new String(helloArray); store the elements of character array in the form of string. Now the array elements get connverted into string and System.out.println(helloString) prints the string hello.
If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.
Ask your questions, our development team will try to give answers to your questions.