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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T18:32:59+00:00 2026-05-22T18:32:59+00:00

As per the concept about static members, they are created/loaded into the memory when

  • 0

As per the concept about static members, they are created/loaded into the memory when there is first call made to its class. And they are common among all instances of that class. Means they are not re-created or re-itialized etc. In addition, They can be accessed by the class name only. There is no need to create object for that class just to access them.

Now my questions are;

  1. Whether static members ever be in
    memory till the application is
    running? even if all the instances
    of that class had been collected by
    GC(garbage collector).
  2. For a big project, where 8-10 teams
    are working together, they dont care
    about the coding of other’s team.
    They may create static members as
    per their need. If all the members
    are cached in memory, would it not
    create overhead over JVM?
  3. By default, all the members of interfaces are STATIC and the use of interfaces are good in many cases. But if i keep my above questions in mind, should i still use interfaces?
  • 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-22T18:33:00+00:00Added an answer on May 22, 2026 at 6:33 pm

    1) Static members are garbage collected only when the class that defines them is itself collected; this in turn can only happen if the defining ClassLoader is collected. This is common in web application containers and plugin architectures.

    2) Yes, defining a large amount of static data can be a bad idea. But it’s like a lot of other things: it’s good if you need it, and bad if you abuse it. Just use common sense.

    3) Again, an interface that defined an array of a thousand Strings would be a bad idea, but of course that’s not normally what people do. Just use common sense. There’s no (memory-related) reason to avoid static variables in general.

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

Sidebar

Related Questions

The concept So, I've already made (upgraded actually) this website with its own Content
can anyone please explain the concept of dispatcher, is it one dispatcher per thread
I was reading this post about branch per feature and this one too and
I wanted to learn this concept as per course syllabus. I need some idea
I have a Concept table of about 1000 rows that I would like to
I'm refactoring about 600 lines of javascript into the module pattern. Here is a
it seems that starting kernel 2.2, they introduced the concept of Capabilities . According
Per man pages, snprintf is returning number of bytes written from glibc version 2.2
Per this helpful article I have confirmed I have a connection pool leak in
Per the Java documentation, the hash code for a String object is computed as:

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.