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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T19:27:37+00:00 2026-06-14T19:27:37+00:00

Possible Duplicate: What is the difference between static int a and int a? I’m

  • 0

Possible Duplicate:
What is the difference between static int a and int a?

I’m trying to get just a simple explanation in simple English. I have tried to read and research on the difference between static int and just int but whatever I read it seems to confuse me more. Let’s say I have a class like this below

class B{
  static int i;
  int i;
  ...
}

In simple English, what is the difference between the two? Imagine you are explaining to a non-programmer.
Someone asked a similar question like this here but it’s not to my satisfaction.

  • 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-14T19:27:39+00:00Added an answer on June 14, 2026 at 7:27 pm

    Here’s a metaphor for you.

    Imagine an organization that has a bank account. That organization, in terms of C++, is your class. Imagine that the organization has representatives (workers, if you want). They are, in terms of C++, instances (or variables) of that class.

    Now, each representative can have his own bank account that is available only to him. No other guys can use it. That would be a normal int.

    However, each worker can also use the organization’s bank account which is shared by them all and doesn’t belong to any of them in particular. That is your static int.


    Now, back to technical terms again, in case you will want it. I’ll try to be clear and concise.

    • Normal int:

      Each variable of the class type will have it’s own personal variable. So in your example, if you make 10 variables of the type B, each and every of them will have their own int i variable inside.

    • static int:

      Static variables are kind of shared by all the variables of the class. A static variable doesn’t belong to any of the class variables, it belongs to the class itself. So if you will create 10 variables of the type B, each of them will be able to access the static int i, but none of them will own it (it’s shared).

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

Sidebar

Related Questions

Possible Duplicate: Difference between (function(){})(); and function(){}(); I am trying to understand a few
Possible Duplicate: Difference between Color.red and Color.RED I have seen that the Java class
Possible Duplicate: Difference between void main and int main? Why is void main() {
Possible Duplicate: difference between string object and string literal Let's say I have two
Possible Duplicate: Calculating the Difference Between Two Java Date Instances How do I get
Possible Duplicate: Difference between static class and singleton pattern? Why would one ever require
Possible Duplicate: difference between Convert.ToInt32 and (int) What it difference between (int) and convert.toint()
Possible Duplicate: Difference between int[] array and int array[] I was sure that this
Possible Duplicate: Difference between static class and singleton pattern? I'm thinking about the choice
Possible Duplicate: Difference between static class and singleton pattern? we use static class for

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.