Create a toString method that takes no parameters and returns a String. This method should use a loop to build and returns a String with the contents of your character array. Solution StringTest.java import java.util.Scanner; public class StringTest { /** * @param args */ static char ch[]; public static void main(String[] args) { // TODO Auto-generated method stub new StringTest(); } public StringTest(){ Scanner scan = new Scanner(System.in); System.out.println(\"Enter the string :\"); String s = scan.nextLine(); setString(s); System.out.println(\"The Entered String is : \"+toString()); } public void setString(String s){ ch = new char[s.length()]; for(int i=0; i<s.length(); i++){ ch[i] = s.charAt(i); } int length = ch.length; System.out.println(\"The length of char array is :\"+length); } public String toString(){ String s = \"\"; for(int i=0; i<ch.length; i++){ s = s + ch[i]; } return s; } } Output: Enter the string : Hi, How are you The length of char array is :15 The Entered String is : Hi, How are you .