Loading

Exercise Number: 1

Final Variable

Scenario: You are managing a fixed deposit account where the interest rate is fixed and cannot be changed.

Task:

  1. Create a class FixedDepositAccount.
  2. Declare a final variable interestRate with a value of 5%.
  3. Attempt to change the interestRate and observe the error.
  4. Print the interestRate.