Java关于图形重叠的计算

snow126 2019-04-12 09:58:30
* Add an abstract public method `boolean overlaps(Shape other)` to `Shape` that
takes a single `Shape` as an argument and returns `true` if the other shape
overlaps the shape it is called on. Assume the squares are upright (parallel
to the axis).
要求:一个Shape类,有内部类Circle和Square,写一个boolean overlaps(Shape other)计算是否两个图形是否有重叠,有返回true,否则false。如何简单的写出圆和正方形,正方形和正方形以及圆和圆是否有重叠。求思路
...全文
189 回复 打赏 收藏 转发到动态 举报
写回复
用AI写文章
回复
切换为时间正序
请发表友善的回复…
发表回复

50,523

社区成员

发帖
与我相关
我的任务
社区描述
Java相关技术讨论
javaspring bootspring cloud 技术论坛(原bbs)
社区管理员
  • Java相关社区
  • 小虚竹
  • 谙忆
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧