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 7764439
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T14:54:45+00:00 2026-06-01T14:54:45+00:00

How often should I use static methods generally? If I have like: Class1 _class34

  • 0

How often should I use static methods generally? If I have like:

Class1 _class34 = new Class1(parameter);

Class1.DoSomething(_class34, parameter1, parameter2, parameter3, parameter4).

or

_class34.DoSomething(parameter1, parameter2, parameter3, parameter).

I’m having a tendency of calling static method of a class and passing an object of the class like in the first example?

What is the best practice concerning these two examples? Is there any performance, design and general practices things I should pay attention to? Which one should I use generally and which one would you choose like in every day coding scenarios. The first example seems more simple to read (you pass all the parameters and do something), in the second you have to read twice that you are working on an object?

It is not really a big deal, just wondering.

  • 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-01T14:54:46+00:00Added an answer on June 1, 2026 at 2:54 pm

    Generally speaking, static methods should only be used when whatever you want to do is independent of any one instance of the class. If you need to directly access or affect the state of a particular instance, a non-static method is usually the way to go.

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

Sidebar

Related Questions

How often should you use git-gc? The manual page simply says: Users are encouraged
How often should I call OpenGL functions like glEnable() or glEnableClientState() and their corresponding
I have a static Command class like this (but with many more commands): class
How often should I commit changes to source control ? After every small feature,
In your experience, how often should Oracle database statistics be run? Our team of
Should Java Objects be reused as often as it can be reused ? Or
I've got some code which sets up a datacontext. Often enough, the datacontext should
My problem is that I don't know whether I should use multiple list view
I have some static websites. By static I mean all the pages are simple
Should programmatic logic be inserted into an MXML Attribute? I have a few Buttons

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.