例4-13和例4-14

public class Tom{
 int leg;
 Tom(int n){
  this.cry();
  leg=n;
  this.cry();
 }


 void cry(){
   System.out.println("我是Tom,我现在有"+leg+"条腿");
  }
 public static void main(String args[]){
  Tom cat=new Tom(4);
 }
}

 

import tom.jiafei.*;
 public class Example4_14{
  public static void main(String args[]){
   SquareEquation equation=new SquareEquation(4,5,1);
   equation.getRoots();
   equation.setCoefficient(-3,4,5);
   equation.getRoots();
  }
 }

posted @ 2013-03-24 20:07  张欣博同学  阅读(91)  评论(0编辑  收藏  举报