title: Print output on the same line
body: <p>I'm making a translator in Java to translate a fake language that I came up with for fun. I input an English word and it returns it's equivalent word in the other language. It's successfully translating everything, but each new word is on a separate line and I just want the output on one line. I'm still new to Java but here is my code:</p>
  
  <pre><code>import java.io.*;
  import java.util.*;
  
  public class Translator {
  
      private static Scanner scan;
  
      public static void main(String[] args) {
  
              HashMap &lt;String, String&gt; XanthiumLang = new HashMap &lt;String, String&gt;();
              XanthiumLang.put("hello", "fohran");
              XanthiumLang.put("the", "krif");
              XanthiumLang.put("of", "ney");
              XanthiumLang.put("to", "dov");
              XanthiumLang.put("and", "ahrk");
  
              Scanner scan = new Scanner(System.in);
              String sentence = scan.nextLine();
              String[] result = sentence.split(" ");
              for(int i = 0; i &lt; result.length; i++){
              if(XanthiumLang.containsKey(result[i])){
                  result[i] = XanthiumLang.get(result[i]);
                     }
                   System.out.println(result[i]);
                 }
          }
   }
  </code></pre>
  
  <p>I only have a few words in the code as of right now and they are stored in a hashmap. Anyways like I said the output of each word is on a separate line, not on just one line. Any ideas or changes to my code would be helpful! </p>