Link to home
Start Free TrialLog in
Avatar of RonWensley
RonWensley

asked on

Theory Question

Greetings,

I am working through someone else's code and learning as I go.  I came across this pice of code and I wonder why would I write this?

private static int EXPECTED_LENGTH_OF_BYTE_ARRAY = 998;
        public static int expectedLengthOfBHMConfigurationArray
        {
            get
            {
                return EXPECTED_LENGTH_OF_BYTE_ARRAY;
            }
        }

Instead of calling expectedLengthOfBHMConfigurationArray and having a 998 returned would it not be more efficient to reference the variable EXPECTED_LENGTH_OF_BYTE_ARRAY directly?
SOLUTION
Avatar of AndyAinscow
AndyAinscow
Flag of Switzerland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of RonWensley
RonWensley

ASKER

Both answer were informative thank you for them.