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

  • SEARCH
  • Home
  • 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 8392953
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T19:39:22+00:00 2026-06-09T19:39:22+00:00

I am still a beginner to java and I have a question on an

  • 0

I am still a beginner to java and I have a question on an efficient way to pass in parameters. When passing in objects in a method is it more efficient to pass in portions of an object or does it not matter at all? for example, lets say I have a Person object which has several attributes (name, height, gender, location, hairColor etc.) and I have a method which needs to work on two of these attributes. When I pass the info into the method, does it save me memory, process time etc to only pass in the needed info (like name and location) or is it the same as just passing in the whole person object?

is:

public void getNamePlace(String name, String location){
\\\\work here
}

any different efficiency-wise than:

public void getNamePlace(Person person){
\\\\work here and get the name location in the method
}

Thanks a lot for the help. I’m sorry if it is a dumb question but I’m trying to figure out the best mentality to approach this. Thank you.

p.s. I am thinking more on the method call itself. How does it work. In isolation, is:

public void getNamePlace(String name, String Location) –> More bits passed around and memory used than –> public void getNamePlace(Person person)

  • 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-06-09T19:39:24+00:00Added an answer on June 9, 2026 at 7:39 pm

    You’re passing reference values. The more values you pass, the more work is being done.

    Is it a measurable difference? Technically, yes–but miniscule in the extreme (e.g., another parameter is another bytecode, and that’s all. Vanishingly small difference in performance and class size.)

    Is it an appreciable difference? No.

    The mentality here is that premature optimization, particularly at this level, isn’t something to deal with.

    Others have pointed out there are readability and data issues that are more important.

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

Sidebar

Related Questions

I'm still a beginner in java. I dont have any idea on how to
This is a real beginner question (I'm still learning the Java basics). I can
I have only started learning python recently. I would still be considered a beginner.
I have been wandering about this for some time now. I'm still a beginner,
i'm still a beginner, and guess it's a simple CakePHP question... all i want
I am still a beginner in java and I am attempting to create a
Is there a way to make Java Exceptions more informative? For example, take this
hello i'm a beginner java developer and this is one question in a list
learning about loops (still a beginner) in VB.net. I have got the below code
I'm very much still a beginner at programming but I have come across the

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.