Java question...

Discussion in 'OT Technology' started by morgue, Nov 29, 2006.

  1. morgue

    morgue New Member

    Joined:
    Jul 10, 2004
    Messages:
    8,278
    Likes Received:
    0
    Q: A method can access the superclass’s private members, but it can not access the subclass private members. What can be inferred about the method?

    My A: It can be inferred that the method is declared inside the superclass, i.e. it's a member of the superclass.

    Am I correct? :wavey:
     
  2. HardTech

    HardTech hungry

    Joined:
    May 5, 2000
    Messages:
    28,103
    Likes Received:
    1
    Location:
    NorCal
    The method is overridden in the subclass.

    I think.
     
  3. morgue

    morgue New Member

    Joined:
    Jul 10, 2004
    Messages:
    8,278
    Likes Received:
    0
    I think that only happens if there's a method declared on the subclass so it would over ride (or hide) the one on the superclass.
     
  4. morgue

    morgue New Member

    Joined:
    Jul 10, 2004
    Messages:
    8,278
    Likes Received:
    0
  5. morgue

    morgue New Member

    Joined:
    Jul 10, 2004
    Messages:
    8,278
    Likes Received:
    0
    anyone?
     
  6. GOGZILLA

    GOGZILLA Double-Uranium Member

    Joined:
    Jan 16, 2003
    Messages:
    10,760
    Likes Received:
    3
    Location:
    Plantation, FL
    sounds right, im not a java pro. in c++ it could also be a friend class method but i dont think you have those in java.
     

Share This Page