1 Star 0 Fork 0

besti1923/JAVA

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
heroTest.java 788 Bytes
一键复制 编辑 原始数据 按行查看 历史
yifei 提交于 5年前 . shiyan5
package text.java;
import java.util.Scanner;
public class heroTest {
public static void main(String[] args){
hero hero1 = new hero(99,6,23,16,8);
hero hero2 = new hero(21,97,16,17,4);
Scanner scan = new Scanner(System.in);
System.out.println("please enter the number of average cd:");
hero2.average_cd=scan.nextInt();
hero1.skill();
hero1.cd();
hero2.cd();
System.out.println(hero2.toString());
if(hero1.compareTo(hero2)==0 )
{
System.out.println("hero1 has better attack damage");
}
else System.out.println("hero2 has better attack damage");
System.out.print("object function test result:");
System.out.println(hero1.hashCode()==885284298);
}
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Java
1
https://gitee.com/besti1923/java.git
git@gitee.com:besti1923/java.git
besti1923
java
JAVA
master

搜索帮助