返回列表 发帖

关于《java从入门到精通》习题答案

管理员,你好,

能否提供每一章上机实践的完整代码啊?初学者有时候在缺少代码的地方弄不懂。

现能否提供第四章上机实践2的完整代码?
分享到: QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友

你看一下光盘内。我记得光盘中有完整的代码。

TOP

好东西,收藏了。

TOP

我也是第4章上机实践第2题弄不明白啊。2天了

TOP

你可以把你不明白的地方说出来,大家帮你分析一下。这样,就知道你的问题所在了。

TOP

你好,我想请教一下,为什么4.6的本章实例的程序运行不了呢?
package cn.com.jaking.project;
public class Book {
        private int id;                           //图书编号
        private String name;                      //图书名称
        private Booktype type;                    //图书类别
        private String author;                    //作者
        private String translat;                  //译者
        private String publishing_company;        //出版社
        private double price;                    //价格
        private int stock;                       //库存数量
        //无参数构造法
        public Book () {
        }
        //带参数构造法
        public Book (int id, String name, Booktype type, String author, String translat, String publishing_company, double price, int stock) {
                this.id = id;
                this.name = name;
                this.type = type;
                this.author = author;
                this.translat = translat;
                this.publishing_company = publishing_company;
                this.price = price;
                this.stock = stock;
        }
public String getAuthor () {
         return author;
}
public void setAuthor (String author) {
         this.author = author;
}
public int getId () {
         return id;
}
public void setId (int id) {
         this.id = id;
}
public Booktype getType () {
         return type;
}
public void setType (Booktype type) {
         this.type = type;
}
public String getName () {
         return name;
}
public void setName (String name) {
         this.name = name;
}
public double getPrice () {
         return price;
}
public void setPrice (double price) {
         this.price = price;
}
public String getPublishing_company () {
         return publishing_company;
}
public void setPublishing_company (String publishing_company) {
         this.publishing_company = publishing_company;
}
public int getStock () {
         return stock;
}
public void setStock (int stock) {
         this.stock = stock;
}
public String getTranslat () {
         return translat;
}
public void setTranslat (String translat) {
         this.translat = translat;
}
}
或者说在Eclipse中怎样去运行?

TOP

你好。关于代码如何运行,你可以看一下光盘中G:\本书源代码运行视频演示下的第4章演示。在里面演示了4.6如何运行。

TOP

返回列表