Kotlinlearncs.online LogoJava
Return to List

Solve: Table Equality

Created By: Pranav Narayanan
/ Version: 2026.10.0

Write a public class Table that has 3 variables: a String: wood, a double: width, and a double: height. You should implement a constructor that initializes these three variables in that order, rejecting null and zero/negative values. You should provide getters for all three variables.

You should also override .equals(), which should return true when two Tables have the same area.

Related Lessons

Stuck? You may find these lessons helpful:

Report a Problem

Attribution must link to this page: https://www.learncs.online/solve/java/table-equality/[email protected]