title: How to add multiple methods on the same object?
body: <p>I'm a beginner to Java. I am wondering if it is possible to add multiple methods on the same object without having to create a new one (in this case - String).</p>
  
  <pre><code>public class DeletAble {
  
      public static void main(String[] args) {
          // Refrain from saving this document
  
          String userName = "sdfsd".trim().substring(0,1).toUpperCase().substring(1).toLowerCase();
          System.out.println(userName);
  
      }
  }
  </code></pre>
  
  <p>The compiler does not give any errors, however nothing prints out. It works if I create another String for the <code>.tolowerCase()</code> method. Is there a way to use these methods like this, and if not: why?</p>