Read-only stored properties in Java
Forums:
class FilmList {
//In Java there are no properties
private int count;
public int getCount() {
return count;
}
public FilmList() {
count = 10;
}
}
FilmList filmList = new FilmList();
int count = filmList.getCount();
//count is 10
- Log in to post comments