本文目录一览:
JAVA考试题目。
1、学生类
public class Student {
private String name;
private String sex;
public Student() {
super();
this.name = "小A";
this.sex = "男";
}
public void show() {
System.out.println("姓名:" + this.name + ",性别:" + this.sex);
}
public void study() {
System.out.println("学生学习");
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getSex() {
return sex;
}
public void setSex(String sex) {
this.sex = sex;
}
@Override
public String toString() {
return "Student [name=" + name + ", sex=" + sex + "]";
}
}
2、大学生类
public class DStudent extends Student {
@Override
public void study() {
// TODO Auto-generated method stub
System.out.println("大学生学习");
}
}
望采纳!!!
JAVA考试选择题
答案保证正确但是多少给点分数么?
1 D 2 B 3 D 4 A 5 A 6 C 7 C 8 D 9 C 10 B 11 D 12 A 13 B 14 A 15 D
java考试选择题
2、D
3、B
4、A
5、D
6、D
7、D
8、C
9、A
10、A
11、A
12、C
13、B
14、D
15、B