title: Primitive Functional Interfaces in Java
body: <p>I want to return double type value in the  given Primitive Functional Interface:</p>
  
  <pre><code>  DoubleFunction&lt;double&gt; db1=(x)-&gt; x+2;         
    System.out.println(db1.apply(23.6));
  </code></pre>
  
  <p>This gives me an error,but the below code is correct:</p>
  
  <pre><code>  DoubleFunction&lt;String&gt; db1=(x)-&gt; x +" is now a String";         
    System.out.println(db1.apply(23.6));
  </code></pre>
  
  <p>I want to know why the generic type should be String?
  Can anyone give me an example which returns int/double in Primitive Functional Interface? </p>