public class Point
{
public:
float GetX();
float GetY();
void SetX( float x );
void SetY( float y );
float x;
float y;
}
Question: How can class Point be changed so that it conforms to the principle of information hiding?
Choice 1 Make GetX and GetY private methods.
Choice 2 Make float x and y be private attributes.
Choice 3 It already conforms to the principle of information hiding, no changes are necessary.
Choice 4 Make SetX and SetY private methods.
Choice 5 Make all methods and attributes private.
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum