public class lx {
class Computer {
String brand; //品牌 }
}
public class SxtStu2 {
// field
int id;
String sname;
int age;
Computer comp;
void study() {
System.out.println("我正在学习!使用我们的电脑," + comp.brand);
}
SxtStu2() {
}
public static void main(String[] args) {
SxtStu2 stu = new SxtStu2();
stu.sname = "张三";
Computer comp = new Computer();
comp.brand = "联想";
stu.comp = comp;
stu.study();
}
}
}