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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T06:09:06+00:00 2026-05-23T06:09:06+00:00

Assume the following: private static boolean A() { int parsedUntil = 0; … …

  • 0

Assume the following:

private static boolean A()
{
  int parsedUntil = 0;
  ...
  ...
  ...
}

Is parsedUntil considered to be a static variable? I noticed that I can’t declare it as static inside this static function.

Follow-up question: I read that a static variable will only be initialized once. Does that mean the first time I call function A() the value will be set to zero, but every other time I call A(), that row is omitted?

  • 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-23T06:09:06+00:00Added an answer on May 23, 2026 at 6:09 am

    No, it’s not a static variable. It’s a local variable. Any variable declared in a method is a local variable. If you want a static variable, you have to declare it outside the method:

    private static int parsedUntil = 0;
    

    There’s no way of declaring a static variable which can only be used within a single method.

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

Sidebar

Related Questions

Assume the following: we have class B, which is a private class nested inside
let's assume we have the following code: public class TestScope { private int a
Assume the following class: public class MyEnum: IEnumerator { private List<SomeObject> _myList = new
Let's assume we've got the following Java code: public class Maintainer { private Map<Enum,
Lets assume following classes definition: public class A { public final static String SOME_VALUE;
assume this following function: int binaryTree::findHeight(node *n) { if (n == NULL) { return
I have something like the following TestObjectCreator{ private static Person person; private static Company
Assume that I have a .NET Workflow Foundation (WF) SequenceActivity class with the following
Assume following component tree: A B C A has a private field (called filter)
assume the following: @interface BOOK : NSObject { @private NSString *title; NSString *author; NSString

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.