Since method invocation uses time to push and pop the call stack, there may be an efficiency cost in using accessors and mutators rather than accessing fields directly. Some compilers are smart enough to skip the method invocation, preserving encapsulation while not incurring a speed cost. Run an experiment to determine whether your compiler does this.
Already registered? Login
Not Account? Sign up
Enter your email address to reset your password
Back to Login? Click here