CJCoding With Joseph
15free / daySign inCreate account

Thompson Rivers University

Question 2

Lab 2 Polymorphism - SM 2025

Create an interface called Visible that includes two methods: makeVisible and makeInvisible. Both methods should take no parameters and should return a boolean result. Describe how a class might implement this interface.


What is an interface?

An interface is like a shell or outline for a class. It doesn’t include the full code, it just lists the method names and says: Any class that wants to follow this interface must fill in the missing code.

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.