Static vs Non--Static members

I'm having some trouble trying to understand the differences between static and non-static members.

I've read a few online information about static members, but I don't understand the purpose of static members.

Can someone try to explain the main points of static members and the differences between static and non-static members?

[352 byte] By [vopoa] at [2007-11-27 10:00:47]
# 1

> I'm having some trouble trying to understand the

> differences between static and non-static members.

>

> I've read a few online information about static

> members, but I don't understand the purpose of static

> members.

> Can someone try to explain the main points of static

> members and the differences between static and

> non-static members?

Static means only one per class. If you have a Class and generate 20 objects of this class or more, they all share the same copies of any static variables. This is as opposed to instance variables of which each Object has its own. If an object changes one of its instance variables, this doesn't affect another object's instance variables.

Having said this, however, vague and general questions are great if you are face to face with a tutor where you can have a conversation but are very difficult to answer in this format. Your best bet is to go through several online articles (and there are many good ones, just google for them) and then coming back with specific questions. Another option is to go through a book or two. Most have a chapter covering this.

Message was edited by:

petes1234

petes1234a at 2007-7-13 0:32:21 > top of Java-index,Java Essentials,Java Programming...