Search:

Type: Posts; User: Pajaro

Search: Search took 0.14 seconds.

  1. Re: static variable accessible in object b, not in object a?

    Thanks.
  2. Re: static variable accessible in object b, not in object a?

    So why is the second a.x = 2? where did 2 come from?
    If I edit out the second b.x assignment, a.x = 1 which is correct. If I leave it unedited, a.x = 2 which is incorrect - it should = 1.
  3. static variable accessible in object b, not in object a?

    Here's simple class that has two instance variables, one static int and one just int. Why am I getting this output?

    Code:

    public class IdentifyMyParts {
    public static int x = 7;
    ...
Results 1 to 3 of 3