`
张玉龙
  • 浏览: 737185 次
  • 性别: Icon_minigender_1
  • 来自: 沈阳
社区版块
存档分类
最新评论
文章列表
//pakage com.hisoft; //三十而立;四十不惑;五十知天命;六十花甲;七十古稀;八十九十耄耋;一百期颐 public class Age{ private int age; public Age(int yage){ age = yage; } public void compareAge(){ switch(age){ case 30:{System.out.println("三十而立"); break; } case 40:{System.out.println("四十不惑"); ...
public class Salary{ private double basicSalary = 2000;//基本工资 private double salary;//税前工资 private double puritySalary;//税后 public Salary(double asalary){ salary = asalary; } public double calPruitySalary(){ if(salary<=2000){ return puritySalary = salary; }else if ...
public class Triangle{ public static void main(String[] args){ for(int i=0;i<=10;i++){ System.out.print("\n"); for(int j=i;j<10;j++){ System.out.print(" "); } for(int j=1;j<2*i;j++){ System.out.print("*"); } } /*fo ...
public class Factorial{ private long n; private long s=1; public Factorial(long num){ n=num; } public void calculateFac(){ for(long i=2;i<=n;i++){ s=s*i; } //System.out.println(s); //return s; } public long getNum(){ return s; } public s ...
//构造方法 public Example(String aname,double ascore){ name = aname; score = ascore; } //业务方法 public String getName(){return name;} public void setScore(double ascore){score=ascore;} public void sortTime(){ //格式化一组时间 //指定排序条件 //使用某个对象对一组时间对象按照排 ...
子类 public class Michael extends Mouse{ private int IQ; public Michael(int id,int age,int IQ){ super(id,age); this.IQ=IQ; } public String toString(){ System.out.print(age+","+id+","+IQ); return age+""+id+""+IQ; } public static voi ...
Global site tag (gtag.js) - Google Analytics