title: How to cast numbers (like int) to "Number"?
body: <p>This could be basic question but I could not find something useful.</p>
  
  <p>Question is: How to convert <code>double</code> or <code>int</code> value to <code>Number</code> type ( to be more specific <code>oracle.jbo.domain.Number</code>)</p>
  
  <p>I tried the following:</p>
  
  <p><strong>for integer values</strong></p>
  
  <pre><code>         int i=9;
           Integer y=new Integer(i);
           oracle.jbo.domain.Number num=(oracle.jbo.domain.Number)y;
  </code></pre>
  
  <p><strong>for float values</strong></p>
  
  <pre><code>         double i=9.5;
           Double y=new Double(i);
           oracle.jbo.domain.Number num=(oracle.jbo.domain.Number)y;
  </code></pre>
  
  <p>But I always get incompatible types error in both cases: </p>
  
  <pre><code>Type 'oracle.jbo.domain.Number' incompatible with 'java.lang.Integer'
  </code></pre>
  
  <p>and</p>
  
  <pre><code>Type 'oracle.jbo.domain.Number' incompatible with 'java.lang.Double'
  </code></pre>
  
  <p>if the conversion did not work, then how to simply create <code>Number</code> object in java</p>