January 6th, 2013, 07:22 PM
Using Accessors Help?
I have an accessor called "getRate" and need to use it in order to give a double called "rate" a value. The double is in a separate file and im not sure how to go about using accessors. Could anyone help me out with this? Thanks in advance.
January 7th, 2013, 02:16 AM
If the double is a static class member, you can access it directly by <className>.<variable name>, provided that the class member is public.
However, if the double is an instance variable, you must first instantiate an instance of the containing class, initialise or perform some processing to assign a double value to your instance variable, then access it from another class using the accessor <instance name>.get<variable name>(), where <variable name> would normally be the name of the double instance variable.
When the programming world turns decent, the real world will turn upside down.