| Author |
share state?????
|
Leandro Oliveira
Ranch Hand
Joined: Nov 07, 2002
Posts: 298
|
|
'Values of the primitive types do not share state' what does this mean??? Sorry if it is a too stupid question!!! but, I'm not very good with english!!! here in my country isn't easy to find good forums!!!
|
 |
marilyn murphy
Ranch Hand
Joined: Aug 28, 2001
Posts: 83
|
|
Primitive values do not share state with other primitive values.jls 4.2 Don't feel bad, it's not an easy statement for a native English speaker either.
|
 |
marilyn murphy
Ranch Hand
Joined: Aug 28, 2001
Posts: 83
|
|
The state of an object typically contains references to other objects. However a primitive cannot contain anything but the primitive value of that type. It cannot contain references to another primitive.
|
 |
Dirk Schreckmann
Sheriff
Joined: Dec 10, 2001
Posts: 7023
|
|
The idea is simple, and you may likely understand it already. An example that further illustrates the concept: If a variable i of type int is declared and given it an initial value 0, and another int variable j is declared and assigned the value of i, then both variables would have the value 0. If i is later assigned a different value such as 1, the value of j is not affected - j would still be 0.Making sense?
|
[How To Ask Good Questions] [JavaRanch FAQ Wiki] [JavaRanch Radio]
|
 |
 |
|
|
subject: share state?????
|
|
|