class Student {
private String name;
private int age;
public static String city;
Student() {
}
Student(int a) {
age = a;
}
public void setName(String n) {
name = n;
}
public String getName() {
return name;
}
private int getAge() {
return age;
}
public void setCity(String c) {
city = c;
}
public String getCity() {
return city;
}
}
當考慮面向對象的特徵時,哪些特徵在程序中清晰地顯示出來?面向對象,繼承,抽象
我怎麼能知道,上面的代碼是:
- 抽象
- 封裝
- 數據隱藏
- 繼承
- 多態性
請讓誰寫這段代碼的人,或讓我們知道,如果您有任何具體和詳細的問題。 –
瞭解有關OOPS概念的更多信息,然後再次通過代碼。 –
瞭解上述代碼是否展現抽象,封裝,繼承或多態性的最好方法是找出這四件事實際上是什麼。有大量的在線資源可以幫助你。 –