Active TopicsActive Topics  Display List of Forum MembersMemberlist  CalendarCalendar  Search The ForumSearch  HelpHelp  Sitemap  Contact Us  RegisterRegister  LoginLogin
OOPS
 GenProgrammers : Certifications : OOPS
Question 38
Author Message
Faqs
Admin Group
Admin Group

Admin

Joined: 13 Apr 2006
Location: India
Online Status: Offline
Posts: 14411
Sample Code:

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.


Quote Faqs Reply






bullet     Posted: 05 Aug 2008 at 11:50am
IP IP Logged
Post Reply Post New Topic
Printable version Printable version

Select Category
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



This page was generated in 0.094 seconds.