title: Java Possible to Return Either Float or Integer?
body: <p>Is it possible to have a function that returns either Integer or Float? I want to have the 2 functions become one if it's possible:</p>
  
  <pre><code>private static Integer parseStringFormatInt(String val){
      System.out.println(Integer.parseInt(val.substring(0, val.indexOf("."))));
      return Integer.parseInt(val.substring(0, val.indexOf(".")));
  }
  private static Float parseStringFormatFloat(String val){
      System.out.println(Float.parseFloat(val.substring(0, val.indexOf("."))));
      return Float.parseFloat(val.substring(0, val.indexOf(".")));
  }
  </code></pre>