摘要:
public class Cal { //定义一个方法,可以计算两个数的和 int add(int a,int b){ public class Test { public static void main(String[] args) { Cal c=new Cal(); //int sum=c.add(89, 99); System.out.println(c.ad... 阅读全文
摘要:
//英雄类 public class Hero { String name; int power=100;//满血 //增加体力 void eat(String food,int value){ System.out.println(this.name+"吃了"+food+"增加血量"); power=(power+value>100)?1... 阅读全文
摘要:
public class Shu2 { public static void main(String[] args) { int o[]={1,3,4,5,0,0,6,6,0,5,4,7,6,7,0,5} ; int n[]=new int[o.length]; //开辟新的数组 int k=0; for(... 阅读全文