Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4064665

Accessing member variables of the base class from the derived class.

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Won't Fix
    • Icon: P4 P4
    • None
    • 1.1.1, 1.1.2
    • client-libs
    • None
    • x86
    • windows_95, windows_nt



      Name: rlT66838 Date: 07/15/97


      I am writing a Extended Button class which supports image, tooltip and so on.

      What I need to do is to set the size of the button and some of
      its properties like foreground color, font and so on in my derived class.
      Eventhough my class extends Button class of awt I am not directly
      allowed to access these variables from my Extended Button class
      because these variables have default access 'package'.
      I am forced to call one of the setXXX functions to set these values.
      Why all these attributes of a class are made "package" instead of
      "protected".
      Why the basic attributes which define, in this case,
      the appearance of a class are not directly accessible
      to the derived classes.

      Ragu.


      ======================================================================

            mmartaksunw Michael Martak (Inactive)
            rlewis Roger Lewis (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: