โ Back to Classes
Question 88
Point2D Equality and Inequality (operator== and operator!=)
Point2D Equality and Inequality (operator== and operator!=)
You are checking if two points are the same location. Create a class Point2D with private ints x and y. Requirements: 1) Constructor Point2D(int x, int y) 2) Overload operator== and operator!= - Two points are equal if both x and y match Do NOT write a main function.
Expected Output:
true true
Topics:
ClassesOperator Overloading
Code Editor
1
Tab to indent ยท Ctrl+Enter to run ยท Ctrl+Space to expand shortcuts (cout, fori)
Your Output
Run your code to see the output here...
Test Cases
Run your code to see test case results.