Zhousan
package edu.xcdq.demo02;
public class Zhousan {
//行为
//播放音乐
public void playMusic(String songName) {
System.out.println("正在播放" + songName);
}
//下载
public void download() {
System.out.println("正在下载");
}
//充电
public void chongdian() {
System.out.println("正在充电");
}
}
Zhousan2
package edu.xcdq.demo02;
public class Zhousan2 {
//属性
String borand;
//方法
public void xuidan(){
System.out.println("手机正在续电");
}
}
Zhousan3
package edu.xcdq.demo02;
public class Zhousan3 {
public static void main(String[] args) {
Zhousan zhousan = new Zhousan();
Zhousan2 zhousan2 = new Zhousan2();
zhousan.playMusic("凉凉");
zhousan.download();
zhousan.chongdian();
zhousan2.xuidan();
}
}