Method of overload
<pre><code>  //*******************************************************
// FlexibleAccount.java
//
// A bank account class with methods to deposit to, withdraw from,
// change the name on, and get a String representation
// of the account.
//*******************************************************
import java.util.Random;
public class FlexibleAccount
{
  private double balance;
  private String name;
  private long acctNum;

  //----------------------------------------------
  //Constructor -- initializes balance, owner, and account number
  //----------------------------------------------
  public FlexibleAccount(double initBal, String owner, long number)
  {
    balance = initBal;
    name = owner;
    acctNum = number;
  }

  public FlexibleAccount(double initBal, String owner, double number)
  {
    Random generator = new Random();
     balance = initBal;
    name = owner;
     number=generator.nextDouble();
     this.acctNum= number;
    }

    public FlexibleAccount(String owner)
    {
     balance = 0;
     name=owner;
     Random generator = new Random();
     number=generator.nextDouble();
     this.acctNum= number;
     }
  //----------------------------------------------
  // Checks to see if balance is sufficient for withdrawal.
  // If so, decrements balance by amount; if not, prints message.
  //----------------------------------------------
  public void withdraw(double amount)
  {
    if (balance &gt;= amount)
       balance -= amount;
    else
       System.out.println("Insufficient funds");
  }

  public void withdraw(double amount,int fee)

  {
   if(balance&gt;=amount)
    balance-= amount+fee;
    else
        System.out.println("Insufficient funds");
    }   

  //----------------------------------------------
  // Adds deposit amount to balance.
  //----------------------------------------------
  public void deposit(double amount)
  {
    balance += amount;
  }

  //----------------------------------------------
  // Returns balance.
  //----------------------------------------------
  public double getBalance()
  {
    return balance;
  }


  //----------------------------------------------
  // Returns a string containing the name, account number, and balance.
  //----------------------------------------------
  public String toString()
  {
    return "Name: " + name + 
"\nAccount Number: " + acctNum +
"\nBalance: " + balance; 
  }
}
</code></pre>

<p>This is what i have and I'm trying to overload the FlexibleAccount 3 times as follow</p>

<ol>
<li>public FlexibleAccount (double initBal, String owner, long number) – initializes the balance, owner, and account number as specified</li>
<li>public FlexibleAccount (double initBal, String owner) – initializes the balance and owner as specified; randomly generates the account number.</li>
<li>public FlexibleAccount (String owner) – initializes the owner as specified; sets the initial balance to 0 and randomly generates the account number.</li>
</ol>

<p>When I compiled i get these error</p>

<pre><code> FlexibleAccount.java:31: possible loss of precision
    found   : double
    required: long
         this.acctNum= number;
                       ^
    FlexibleAccount.java:39: cannot find symbol
    symbol  : variable number
    location: class FlexibleAccount
         number=generator.nextDouble();
         ^
    FlexibleAccount.java:40: cannot find symbol
    symbol  : variable number
    location: class FlexibleAccount
         this.acctNum= number;
                   ^
</code></pre>

<p>How do I fix this and is this the right way to overload?</p>
