为了账号安全,请及时绑定邮箱和手机立即绑定
import java.util.Scanner;


public class Car {
       public String name;
       public int money;
       public int people;
       public int things;
       public double thing;
       public Car(String name, int money, int people){
    	   this.name=name;
    	   this.money=money;
    	   this.people=people;
    	   System.out.println(   name  + "      "  + money  + "元/天"  + "         " + "载人:" + people + "人");
       }
       public Car (String name, int money, int people, int things){
    	   
    	   this.name=name;
    	   this.money=money;
    	   this.people=people;
    	   this.things=things;
    	   System.out.println( name +  "                             "  + money + "元/天" + "         " + "载人:" + people + "人" + "         " + "载货" + things + "吨" );
       }
       
    public Car (String name, int money,  double thing){
    	   
    	   this.name=name;
    	   this.money=money;
    	   this.thing=thing;
    	   System.out.println(  name +  "                       "  + money + "元/天" + "         " + "载货:" + thing + "吨" );
       }
       
       
}


正在回答

举报

0/150
提交
取消
Java入门第二季 升级版
  • 参与学习       530714    人
  • 解答问题       6091    个

课程升级!以终为始告别枯燥,在开发和重构中体会Java面向对象编程的奥妙

进入课程
意见反馈 帮助中心 APP下载
官方微信