Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 3 of 3

Thread: static

  1. #1
    Junior Member
    Join Date
    Feb 2014
    Posts
    23
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default static

    What happens to a static variable that is defined within a method of a class ?


  2. #2
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,042
    Thanks
    63
    Thanked 2,708 Times in 2,658 Posts

    Default Re: static

    Please post the code you are asking about. What happens when you compile and execute it?
    If you don't understand my answer, don't ignore it, ask a question.

  3. #3
    Senior Member
    Join Date
    Jul 2013
    Location
    Europe
    Posts
    666
    Thanks
    0
    Thanked 121 Times in 105 Posts

    Default Re: static

    Quote Originally Posted by gautammuktsar@gmail.com View Post
    What happens to a static variable that is defined within a method of a class ?
    I dont see how this would be possible. Maybe you are confusing something; if you show code that you are unsure about maybe we could help you out more.

Similar Threads

  1. topic related to static final variable and static block !!!!
    By Arnab Kundu in forum Java Theory & Questions
    Replies: 4
    Last Post: July 19th, 2013, 09:06 AM
  2. topic related to static final variable and static block !!!!
    By Arnab Kundu in forum What's Wrong With My Code?
    Replies: 0
    Last Post: July 18th, 2013, 12:12 PM
  3. Replies: 6
    Last Post: May 3rd, 2013, 04:25 PM
  4. Replies: 10
    Last Post: September 6th, 2010, 04:48 PM