Classes in Coding

  • A class is the template for the standard from which Objects are made from it
  • Data Encapsulation: to hide a variable from manipulation. Ensuring the variable can only be changed via a method of an Object from the Class.
    //From class of BankAccount(), object 'account' can only change balance via object.method()
    account.deposit(50);
    account.withdraw(20)