ONJava.com -- The Independent Source for Enterprise Java
oreilly.comSafari Books Online.Conferences.

advertisement

AddThis Social Bookmark Button
Article:
  Nested Classes, Part 1
Subject:   Accessing Protected Members
Date:   2004-05-18 12:33:43
From:   bdell
I changed resolution from private to protected access and ColorMonitorScreen compiled just fine, so I don't think the statement, "Since ColorPixelPoint is not a member of BasicMonitorScreen, access to BasicMonitorScreen's private and protected members is not allowed," is entirely correct.


I only tried it with 1.5beta, so maybe it's a language change, but I think it makes sense. A member of a sub-class should have access to protected members of the super-class.


1 to 1 of 1
  1. Accessing Protected Members
    2004-05-18 14:33:35  Robert Simmons, Jr. | O'Reilly Author [View]

    • Accessing Protected Members
      2004-05-18 21:28:10  bdell [View]

      • Accessing Protected Members
        2004-05-21 15:42:38  kristianmonsen [View]

1 to 1 of 1