What does this code achieve in terms of encapsulation?
class Student {
private:
int roll;
public:
void setRoll(int r) { roll = r; }
int getRoll() { return roll; }
};
Data hiding but no encapsulation
Encapsulation without data hiding
Both encapsulation and data hiding
None of the above
This question is part of this quiz :
Encapsulation