
Java程序设计,创建一个汽车类CarModel.java,
它里面有2个不同的构造函数,CarManufactory.java可以应用这些构造方法创建不同类型的汽车CarModel.java设计要求如下:定义style(Strin...
它里面有2个不同的构造函数,CarManufactory.java可以应用这些构造方法创建不同类型的汽车 CarModel.java设计要求如下: 定义style(String),color(String),category(String)注:括号中为变量类型 创建第一个构造函数,分别给以上变量赋值,要求为该构造函数定义三个形参,分别赋给相应的变量,形参的值在对象创建时给出 创建第二个构造函数,此构造函数过程为空 定义三个方法,分别返回style,color,cat
展开
2014-10-23
展开全部
public class CarManufactory{
private String style;
private String color;
private String category;
public String getStyle(){
return this.style;
}
public String getColor(){
return this.color;
}
public String getCategory(){
return this.category;
}
public CarManufactory(String style,String color,String category){
this.style = style;
this.color = color;
this.category = category;
}
public CarManufactory(){}
}
private String style;
private String color;
private String category;
public String getStyle(){
return this.style;
}
public String getColor(){
return this.color;
}
public String getCategory(){
return this.category;
}
public CarManufactory(String style,String color,String category){
this.style = style;
this.color = color;
this.category = category;
}
public CarManufactory(){}
}
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
public class CarManufactory {
private String style;
private String color;
private String category;
public CarManufactory(String style, String color, String category) {
super();
this.style = style;
this.color = color;
this.category = category;
}
public CarManufactory() {
super();
// TODO Auto-generated constructor stub
}
public String getStyle() {
return style;
}
public String getColor() {
return color;
}
public String getCategory() {
return category;
}
}
private String style;
private String color;
private String category;
public CarManufactory(String style, String color, String category) {
super();
this.style = style;
this.color = color;
this.category = category;
}
public CarManufactory() {
super();
// TODO Auto-generated constructor stub
}
public String getStyle() {
return style;
}
public String getColor() {
return color;
}
public String getCategory() {
return category;
}
}
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
2014-10-23
展开全部
public class CarModel{
private String style;
private String color;
private String category;
public CarModel(String style, String color, String category) {
this.style = style;
this.color = color;
this.category = category;
}
public CarModel(){}
public String getStyle() {
return style;
}
public String getColor() {
return color;
}
public String getCategory() {
return category;
}
}
private String style;
private String color;
private String category;
public CarModel(String style, String color, String category) {
this.style = style;
this.color = color;
this.category = category;
}
public CarModel(){}
public String getStyle() {
return style;
}
public String getColor() {
return color;
}
public String getCategory() {
return category;
}
}
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询