__________________
| Instrument |
| void play() |
| String what() |
| void adjust() |
|________________|
/|\(左面是箭头)
_________________|_______________
| | |
| | |
_______|________ ____|__________ ___|____________
| Wind | | Percussion | | Stringed |
| void play() | |void play() | | void play() |
| String what()| |String what()| | String what()|
| void adjust()| |void adjust()| | void adjust()|
|______________| |_____________| |______________|
/|\(左面是箭头)
|—————-|
| |
________|______ __|_______________
| Woodwind | | Bress |
|void play() | | void play() |
|String what()| | void adjust() |
|_____________| |________________|
这个图比上面的图清楚一些
| Instrument |
| void play() |
| String what() |
| void adjust() |
|________________|
/|\(左面是箭头)
_________________|_______________
| | |
| | |
_______|________ ____|__________ ___|____________
| Wind | | Percussion | | Stringed |
| void play() | |void play() | | void play() |
| String what()| |String what()| | String what()|
| void adjust()| |void adjust()| | void adjust()|
|______________| |_____________| |______________|
/|\(左面是箭头)
|—————-|
| |
________|______ __|_______________
| Woodwind | | Bress |
|void play() | | void play() |
|String what()| | void adjust() |
|_____________| |________________|
这个图比上面的图清楚一些
| Instrument |
| void play() |
| String what() |
| void adjust() |
|________________|
/|\(左面是箭头)
_________________|_______________
| | |
| | |
_______|________ ____|__________ ___|____________
| Wind | | Percussion | | Stringed |
| void play() | |void play() | | void play() |
| String what()| |String what()| | String what()|
| void adjust()| |void adjust()| | void adjust()|
|______________| |_____________| |______________|
/|\(左面是箭头)
|—————-|
| |
________|______ __|_______________
| Woodwind | | Bress |
|void play() | | void play() |
|String what()| | void adjust() |
|_____________| |________________|
public class Instrument{}
另外,给你个建议,如果您每一个class 都放在一个.java文件里面的话
请您定义为public行吗!具体细节请察看 [think-in-java]谢谢!祝你好运!
public class Instrument{
void play()
{
System.out.println("Instrument-play");
}
String what()
{
System.out.println("Instrument-what");
}
void adjust()
{
System.out.println("Instrument-adjust");
}
}