Java 中的扑克牌
我的问题是我必须用java编写一个程序来创建不同的扑克牌 并充分演示了扑克牌的玩法。
如何为该程序编写 equals 方法? equals 方法应该被重写我有点知道如何编写 toString 方法。
它不需要任何 Mutator 方法。它需要其他方法。
这就是我需要帮助的全部。如果您能帮助我,那就太好了,我感谢您花时间帮助我。
My question is I have to write a program in java that creates different playing cards
and adequately demonstrates the methods of Playing Card.
how to write equals methods for this program? The equals method should be overridden I kind of know How to write a toString method.
It does not want any Mutator methods. it needs Other methods.
That's all I need help on. If you can help me that would be great and I thank for you time for helping me.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
此问题位于 Java 5 Enum
另外,您关于 equals/hashmap 的问题位于 Java FAQ
This problem is in the tutorial for Java 5 Enum
Also your question on equals/hashmap is in the Java FAQ
这是 Rank 枚举的代码。
这是 PlayingCard 构造函数。
Here is code for the Rank enum.
Here is the PlayingCard constructor.