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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T12:54:48+00:00 2026-06-14T12:54:48+00:00

Possible Duplicate: Why are static variables considered evil? Having studied Object oriented programming and

  • 0

Possible Duplicate:
Why are static variables considered evil?

Having studied Object oriented programming and design in college a few years back, i remember lecturers getting pretty angry at people using static variables or static methods, as they describe static to be of a very bad design.

My understanding is this
Something of type static, is something that gains global “vision” i.e. it can be accessed by anything.

Is my understanding correct? is there information about the use of static that makes it bad use? and is there a way to avoid using static variables or methods in your code?

btw, i am aware that static for the main method is a pre-requisite to the successful operation of the application.

  • 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-14T12:54:49+00:00Added an answer on June 14, 2026 at 12:54 pm

    static mainly used for to accessing class members without creating class instance. As you know that why we are writing public static void main() just bcoz at the run time jvm can access this method without creating the class object and start up your program.

    Its depending on your requirement that how you used or say how to declaring member of class using access specifier as private, public, default and protect for access level while the static was for make that as static with access level.

    Without static you must declare your member as public or if you inherit your class then make as protected also. As in the same package you define the class then just static for inheriting the class. And for using without inhert class you need to create object of that class and then you can access there members (Note it based on access specifier)

    here is the link below for more detail

    http://xahlee.info/java-a-day/access_specifiers.html

    http://www.javabeginner.com/learn-java/introduction-to-java-access-modifiers

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

Sidebar

Related Questions

Possible Duplicate: Why are static variables considered evil? I have the habit of using
Possible Duplicate: Do static members of a class occupy memory if no object of
Possible Duplicate: Overriding static variables when subclassing I have a set of classes that
Possible Duplicate: Why global and static variables are initialized to their default values? What
Possible Duplicate: file scope and static floats What are static variables? Here is a
Possible Duplicate: Static class variables in Python What is the Python equivalent of static
Possible Duplicate: When to use static vs instantiated classes I'm having a little trouble
Possible Duplicate: Static Variables in WCF So I am fairly new to using WCF
Possible Duplicate: Static variables in C++ // x.h int i = 3; // x1.cpp
Possible Duplicate: accessing static member variables I have a symbol inst which is an

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.