title: java inheritance and method
body: <p><em><strong>I am having problems trying to compile following code based on this requirement:</em></strong></p>
  
  <p>Given an existing class, BankAccount, containing: 
  a constructor accepting a String corresponding to the name of the account holder.
  a method, getBalance, that returns a double corresponding to the account balance.
  a method withdraw that accepts a double, and deducts the amount from the account balance.
   Write a class definition for a subclass, CheckingAccount, that contains: 
  a boolean instance variable, overdraft. (Having overdraft for a checking account allows one to write checks larger than the current balance).
  a constructor that accepts a String and a boolean. The String parameter is used in the invocation of the superclass (BankAccount) constructor, while the boolean is used to initialize the overdraft instance variable.
  a method, hasOverdraft, that returns a boolean. hasOverdraft returns true if the account supports overdraft.
  a method, clearCheck, that accepts a double and returns a boolean. clearCheck will determine if the amount (of the check) can be cashed-- this will be the case if the amount is less than the balance in the account, or if the account allows overdraft. If the check can be cashed, clearCheck returns true, and also calls the withdraw method to update the account balance; otherwise, clearCheck returns false.</p>
  
  <p><em><strong>Code:</em></strong></p>
  
  <pre><code>public class CheckingAccount extends BankAccount {
  private boolean overdraft; 
  
  public CheckingAccount(String a, boolean overdraft) {
  this.name = super.name;
  this.overdraft = overdraft;}
  
  boolean hasOverdraft() {if(overdraft); return true;}
  
  boolean clearCheck(double checkAmount) {if(checkAmount &lt; balance || hasOverdraft() == true); return true &amp;&amp; withdraw();}
  }
  </code></pre>
  
  <p><em><strong>Error:</em></strong></p>
  
  <pre><code>CheckingAccount.java:4: error: constructor BankAccount in class BankAccount cannot be applied to given types;
  public CheckingAccount(String a, boolean overdraft) {
                                                      ^
    required: String
    found: no arguments
    reason: actual and formal argument lists differ in length
  CheckingAccount.java:5: error: name has private access in BankAccount
  this.name = super.name;
      ^
  CheckingAccount.java:5: error: name has private access in BankAccount
  this.name = super.name;
                   ^
  CheckingAccount.java:10: error: method withdraw in class BankAccount cannot be applied to given types;
  boolean clearCheck(double checkAmount) {if(checkAmount &lt; balance || hasOverdraft() == true); return true &amp;&amp; withdraw();}
  </code></pre>