I have a project that I created working perfectly without any errors when doing it at home. However when I import the project to a computer at school, I'm getting two code errors from two different classes.
First Error
Main Class
bank.getAccounts().forEach((i,b)->System.out.println(b));
Illegal start of type ) expected;
Illegal start of expression ; expected;
Second Error
BankProcess Class
bankAccounts.remove(bankAccount.getAccountId(), bankAccount);
No suitable methods found for remove....
I could this be happening? No such errors appear on home computer.
package Coursework1;
import java.util.*;
public class Bank {
  //Creates a new treemap in which Bank Accounts will be stored in.
  private TreeMap < Integer, BankAccount > bankAccounts = new TreeMap < Integer, BankAccount > ();
  //This method returns all bank accounts in the treemap.
  public TreeMap < Integer, BankAccount > getAccounts() {
    return bankAccounts;
  }
  //This method adds a bank account to the treemap.
  public void setAccounts(TreeMap < Integer, BankAccount > accounts) {
    this.bankAccounts = accounts;
  }
  //This method return a bank account using the account number.
  public BankAccount getAccount(Integer accountNumber) {
    return bankAccounts.get(accountNumber);
  }
  //This method removes a bank account from the treemap.
  public void removeAccounts(TreeMap < Integer, BankAccount > accounts) {
    this.bankAccounts = accounts;
  }
}
 
     
    