CJCoding With Joseph
15free / daySign inCreate account

Thompson Rivers University

PasswordLockable Interface

Assignment 2 Product - SM 2025

What is this for?

In this assignment, every product record should be locked or unlocked using a password. When a record is locked, no one should be able to update its information. We create an interface to define the rules that any class must follow if it wants to support this locking behavior.

This way, any object that wants to be "lockable" must include the same four methods: one to set a password, two to lock or unlock, and one to check if it's currently locked.

Members only

Keep reading this lesson

You've reached the end of the free preview. Unlock the rest of this lesson plus 54 more lessons in Thompson Rivers University.

  • Unlimited coding questions
  • Unlimited access to all classroom material
  • Weekly live call for questions and guidance
  • 3,000 AI tutor tokens / month
  • Personal SQL database (3 MB)
  • Progress tracking

Cancel any time.