You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
|
public class Jb25_ObjExtends
|
|
|
|
|
{
|
|
|
|
|
public static void main(String[] args)
|
|
|
|
|
{
|
|
|
|
|
Student a = new Student();
|
|
|
|
|
a.name = "xiaoming";
|
|
|
|
|
a.age = 17;
|
|
|
|
|
a.study();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
/*
|
|
|
|
|
<EFBFBD>̳е<EFBFBD><EFBFBD>ŵ<EFBFBD>:
|
|
|
|
|
<EFBFBD><EFBFBD><EFBFBD>ߴ<EFBFBD><EFBFBD>븴<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>֮<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˹<EFBFBD>ϵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>̬<EFBFBD>ṩ<EFBFBD><EFBFBD>ǰ<EFBFBD><EFBFBD>
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
class Person
|
|
|
|
|
{
|
|
|
|
|
String name;
|
|
|
|
|
int age;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
class Student extends Person
|
|
|
|
|
{
|
|
|
|
|
void study()
|
|
|
|
|
{
|
|
|
|
|
System.out.println(age+"<22><><EFBFBD><EFBFBD>"+name+"<22><><EFBFBD><EFBFBD>ѧϰ");
|
|
|
|
|
}
|
|
|
|
|
}
|