title: I'm trying to do stuff with inheritance but none of it will work
body: <p>Im trying to get different variables from loan but none of them ever get to loan.java. My inheritance goes from Loan.Java > BusinessLoan.java > CreateLoan.java. I can get a variable from CreateLoan to display in business but when I set it in business I can't grab it. And I know some of this stuff is stupid but this is my final so some of the stuff was required. Heres my code</p>
  
  <p>Loan.java</p>
  
  <pre><code>package Construction;
  
  public class Loan implements LoanConstant{
      public static int loanNumber;
      public static String lastName;
      public static int loanAmount;
      public static int interestRate;
      public static int term;
      public int primeRate;
  
      public int getLoanNumber() { return loanNumber; }
      public void setLoanNumber(int n) { n = loanNumber; }
  
      public String getLastName() { return lastName; }
      public void setLastName(String s) { s = lastName; }
  
      public int getLoanAmount() { return loanAmount; }
      public void setLoanAmount(int n) {
          n = loanAmount; 
          if (loanAmount &gt; MAX_LOAN_AMOUNT)
              loanAmount = MAX_LOAN_AMOUNT;
          }
  
      public int getTerm() { return term; }
      public void setTerm(int n) { 
          n = term; 
          if (term == 1) {
              term = SHORT_TERM;
          } else if (term == 3) {
              term = MEDIUM_TERM;
          } else if(term == 5) {
              term = LONG_TERM;
          } else
              term = SHORT_TERM;
      }
  
      public int getInterestRate() { return interestRate; }
      public void setInterestRate(int i) { i = interestRate; }
  
      public static void displayAll() {
          System.out.println("The Company's Name is " + COMPANY_NAME);
          System.out.println("The loan number is " + loanNumber);
          System.out.println("The last name on the loan is " + lastName);
          System.out.println("The loan amount is " + loanAmount);
          System.out.println("The interest rate on the loan is " + interestRate);
          System.out.println("The term on the account is " + term);
      }
  }
  </code></pre>
  
  <p>PersonalLoan.java</p>
  
  <pre><code>package Construction;
  
  public class PersonalLoan extends Loan{
  
      public PersonalLoan(int ln, String last, int la, int term) {
          setLoanNumber(ln);
          setLastName(last);
          setLoanAmount(la);
          setTerm(term);
          interestRate = (int)((primeRate * 0.02) + primeRate);
          setInterestRate(interestRate);
      }
  }
  </code></pre>
  
  <p>BusinessLoan.java</p>
  
  <pre><code>package Construction;
  
  public class BusinessLoan extends Loan{
  
      public BusinessLoan(int ln, String last, int la, int term) {
          setLoanNumber(ln);
          setLastName(last);
          setLoanAmount(la);
          setTerm(term);
          interestRate = (int)((primeRate * 0.01) + primeRate);
          setInterestRate(interestRate);
      }
  
  }
  </code></pre>
  
  <p>CreateLoan.java</p>
  
  <pre><code>package Construction;
  
  import java.util.Scanner;
  
  
  public class CreateLoan {
  
      public static void main(String[] args) {
          int x = 0;
          int primeRate;
          String type;
          Scanner input = new Scanner(System.in);
          Loan[] loans = new Loan[5];
          System.out.println("Please enter the prime interest rate");
          primeRate = input.nextInt();
          primeRate = primeRate/100;
          input.nextLine();
  
          for(x = 0; x &lt; 6; ++x) {
              System.out.println("Please enter a loan type. Choose either Business or Personal. If you don't type it like that you'll get an error.");
              type = input.nextLine();
              if (type.equalsIgnoreCase("Business")) {
                  System.out.println("What is the account number on the loan?");
                  int ln = input.nextInt();
                  System.out.println("What is the last name on the account?");
                  String last = input.nextLine();
                  input.nextLine();
                  System.out.println("What is the loan amount? If you put more then 100k it'll only accept up to 100k");
                  int la = input.nextInt();
                  System.out.println("What is the term on the account? If you enter something other then 1, 3, or 5 it will default to a short term.");
                  int term = input.nextInt();
                  loans[x] = new BusinessLoan(ln, last, la, term);
                  System.out.println("The Company's Name is " + Loan.COMPANY_NAME);
                  System.out.println("The loan number is " + loans[x].getLoanNumber());
                  System.out.println("The last name on the loan is " + loans[x].getLastName());
                  System.out.println("The loan amount is " + loans[x].getLoanAmount());
                  System.out.println("The interest rate on the loan is " + loans[x].getInterestRate());
                  System.out.println("The term on the account is " + loans[x].getTerm());
              }
              else if (type.equalsIgnoreCase("Personal")) {
                  System.out.println("What is the account number on the loan?");
                  int ln = input.nextInt();
                  System.out.println("What is the last name on the account?");
                  String last = input.nextLine();
                  input.nextLine();
                  System.out.println("What is the loan amount? If you put more then 100k it'll only accept up to 100k");
                  int la = input.nextInt();
                  System.out.println("What is the term on the account? If you enter something other then 1, 3, or 5 it will default to a short term.");
                  int term = input.nextInt();
                  loans[x] = new PersonalLoan(ln, last, la, term);
                  System.out.println("The Company's Name is " + Loan.COMPANY_NAME);
                  System.out.println("The loan number is " + loans[x].getLoanNumber());
                  System.out.println("The last name on the loan is " + loans[x].getLastName());
                  System.out.println("The loan amount is " + loans[x].getLoanAmount());
                  System.out.println("The interest rate on the loan is " + loans[x].getInterestRate());
                  System.out.println("The term on the account is " + loans[x].getTerm());
              } else {
                  System.out.println("You've entered an invalid type. Please restart and try again.");
                  System.exit(0);
              }
          }
      }
  }
  </code></pre>
  
  <p>LoanConstants.java</p>
  
  <pre><code>package Construction;
  
  public interface LoanConstant {
      public final static int SHORT_TERM = 1;
      public final static int MEDIUM_TERM = 3;
      public final static int LONG_TERM = 5;
      public final static String COMPANY_NAME = "Sanchez Construction";
      public final static int MAX_LOAN_AMOUNT = 100000;
  }
  </code></pre>