title: User input and object creation inside method
body: <p>I have a Java Class named Real</p>
  <pre><code>public class Real {
    private long wholeNumPart;
    private long decimalPart;
    public Real(){
          wholeNumPart =0;
          decimalPart=0;
      }
      public Real(long wholeNumPart, long decimalPart) {
          this.wholeNumPart =wholeNumPart;
          this.decimalPart = decimalPart;
      }
      
      public long getWholeNumPart() {
          return wholeNumPart;
      }
      public long getDecimalPart() {
          return decimalPart;
      }}
  </code></pre>
  <p>I have another class name RealApplication where I need to create two methods</p>
  <ol>
  <li>createRealObject() that allows a user to input a real number and creates an object representing
  that number.
  2.createRealNumber() which accepts an object of type Real and returns a real number represented
  by that object.</li>
  </ol>
  <hr />
  <p>I am having difficulty creating these two methods
  Here is what I've done so far</p>
  <pre><code>import java.util.Scanner;
  public class RealApplication {
      
      public void createRealNumber() {
          Scanner sc=new Scanner(System.in);
          
          //Allows user input
          System.out.print(&quot;Please, enter a real number: &quot;);
          long n = sc.nextLong();
          
          
          //Creates Real object ( is this correct????)
          Real in = new Real();
          
      }
      
      public long createRealNumber(Real num) {
          long realNum=0;
  
          //I do not know what to write here :(
  
          return realNum;
      }
  }
  </code></pre>