Search:

Type: Posts; User: Norm

Search: Search took 0.11 seconds.

  1. Replies
    9
    Views
    1,250

    Re: A question of accessibility in OOP

    That constructor allows you to give an individual name to each Pawn.
  2. Replies
    9
    Views
    1,250

    Re: A question of accessibility in OOP

    When would a Pawn not be a "PAWN"? That String could be in the constructor, not passed. The code would allow:

    pawn1White = new Pawn("WHITE", "Trooper" , 6 , 0 , this );
  3. Replies
    9
    Views
    1,250

    Re: A question of accessibility in OOP

    Question: Why pass "PAWN" to a Pawn class object? When would a Pawn not be a "PAWN"?


    Yes, the reference would be to the current version.
  4. Replies
    9
    Views
    1,250

    Re: A question of accessibility in OOP

    Pass a reference to an instance of class A to class B to allow class B to access class A's variables and methods.
Results 1 to 4 of 4