Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7068041
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T05:16:32+00:00 2026-05-28T05:16:32+00:00

I was reading this section in the Android Dev Guide : here and I

  • 0

I was reading this section in the Android Dev Guide :

here

and I was wondering what is a “Virtual method call” and what does it mean when it says “locally” using a getter/setter? I’m trying to figure out if what they’re saying is avoid using methods EVER (for instance a method from an instanced object) or just inside a class you’re already working in to get a variable?

To sum it up basically, if I’m in a different class and I want to know the value of a variable in a different class will it be more expensive to do otherclass.getX() than to do otherclass.x? Or is it the same performance if it’s not within the current class to do either a method or access a public variable directly?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T05:16:32+00:00Added an answer on May 28, 2026 at 5:16 am

    Using getters and setters is more expensive because first the VM will lookup the method from a virtual method table and then make the call.
    For faster access on Android directly accessing member variables reduces the overhead

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I was reading this documentation page, http://developer.android.com/reference/android/util/Log.html . The section here caught my eye:
Reading Java Concurrency In Practice, there's this part in section 3.5: public Holder holder;
Reading this post has left me wondering; are nightly builds ever better for a
I am currently developing my first Android application by reading Dev Documentation at Android
I'm reading this article that compares XML to JSON, and in the comments section,
Reading the section Zend_Application_Resource_Modules in the docs here: http://framework.zend.com/manual/1.10/en/zend.application.available-resources.html I noticed this: You can
I'm reading this section of Java EE tutorial. http://download.oracle.com/javaee/6/tutorial/doc/bncfu.html#bncfy And have a question: If
I have been reading this ebook about DDD and it says that only highly
I'm reading this article and the section on the promise abstraction seems a little
i've been reading some lisp code and came across this section, didn't quite understand

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.