package com.soar.chario;
public class Demo6_Wrap {
public static void main(String[] args) {
SoarStudent ss = new SoarStudent(new Student());
ss.code();
}
}
interface Coder{
public void code();
}
class Student implements Coder{
@Override
public void code() {
System.out.println("javase");
System.out.println("javaweb");
}
}
class SoarStudent implements Coder{
private Student s;
public SoarStudent(Student s){
this.s = s;
}
@Override
public void code() {
s.code();
System.out.println("ssh");
System.out.println("数据库");
System.out.println("大数据");
System.out.println("...");
}
}