根据下面的类图实现课本和作者? [英] Implement classes book and author according to the class diagrams below?

查看:71
本文介绍了根据下面的类图实现课本和作者?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

BlueJ Java问题



书籍:

字段:

-String bookName

- 作者



初始化上述字段的构造函数

仅用于初始化bookName的构造函数



作者

字段

-字符串名称

-String dob

并且

一个构造函数来初始化上面的字段



我尝试了什么:



我真的不知道该怎么办:(如何使用两个班级



public class Book

解决方案

转到 Java™教程 [ ^ ]并研究有关的部分类。

BlueJ Java question

Book:
fields:
-String bookName
-Author author
And
One constructor to initialize the above fields
One constructor to initialize bookName only

Author
fields
-String name
-String dob
And
One constructor to initialize the above fields

What I have tried:

I really don't know what to do :( How to use two classes

public class Book

解决方案

Go to The Java™ Tutorials[^] and study the sections on classes.


这篇关于根据下面的类图实现课本和作者?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆