title: Convert concatenated characters (char) to String literal in Java
body: <pre><code>public class Tester{
    public static void main (String args[]){
  
    String word="sandwich";
    char newWord[]=word.toCharArray();
  
    System.out.println(word.equals(transform(newWord)));
    if (word.equals(transform(newWord))){
        System.out.println("same");}
        else{
          System.out.println("not");
        }
  
    }
    public static String transform(char [] newWord){
      for(int i=0; i&lt;newWord.length;i++)
      {
        System.out.print(String.valueOf(newWord[i]));
        //System.out.print(""+newWord[i]);
  
      }
     return "";
    }
      }
  </code></pre>
  
  <p>RESULT>> sandwich false
           sandwich not</p>
  
  <p>Is there a way to convert a concatenated 'string' of characters to a string literal?</p>