title: Can I make a utility method static?
body: <p>I have some functions like:</p>
  
  <ol>
  <li><p>One that takes input on string and modifies and returns the string</p></li>
  <li><p>Function that takes a string (holding XML) as input and parses it and returns an object.</p></li>
  </ol>
  
  <p>For example:</p>
  
  <pre><code>public class MyUtils{
  
      public static modifyString(String str){
          return someString;
      }
  
      public MyObject parseString(String xml){
          //Parse XML
          return obj;
      }
  }
  </code></pre>
  
  <ol>
  <li>Can I make such functions static, so that anyone can use those without creating instance of my class?</li>
  <li>What if two threads call the function at same time? Is the code thread-safe? If yes/no, how?</li>
  <li>When should I use a singleton object and when should I use static methods?</li>
  </ol>