changing public static final field example

This commit is contained in:
m.raheem
2019-08-18 13:54:19 +02:00
parent 8d96692840
commit 12bc0fcfd9
2 changed files with 11 additions and 1 deletions

View File

@@ -10,6 +10,7 @@ public class Student {
private BigDecimal grade; //new representation
private String name;
private int age;
public static final String GENDER = "male";
public int getGrade() {
return grade.intValue(); //Backward compatibility
@@ -33,6 +34,10 @@ public class Student {
this.age = age;
}
public int getAge() {
return age;
}
@Override
public String toString() {
return this.name;