//构造函数的使用.
class person {
int age;
public person(int a)
{
age = a;
}
public void speak(){
System.out.println("我今年"+age+"岁了");
}
}
public class structrue {
public static void main(String[] args) {
person p = new person(18);
p.speak();
}
}